diff --git a/CITATION.cff b/CITATION.cff index d4476e5..9391faa 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,7 +5,7 @@ authors: given-names: "Otto" orcid: "https://orcid.org/0000-0002-3363-9287" title: "Pyreadstat" -version: 1.3.5 +version: 1.3.6 doi: 10.5281/zenodo.6612282 date-released: 2018-09-24 url: "https://github.com/Roche/pyreadstat" diff --git a/README.md b/README.md index d1fb846..b4ff416 100644 --- a/README.md +++ b/README.md @@ -969,4 +969,4 @@ pull request to ReadStat first. [alchemyst](https://github.com/alchemyst): improvements to docstrings -[bmwiedemann](https://github.com/bmwiedemann), [toddrme2178 ](https://github.com/toddrme2178), [Martin Thorsen Ranang](https://github.com/mtr): improvements to source code +[bmwiedemann](https://github.com/bmwiedemann), [toddrme2178 ](https://github.com/toddrme2178), [Martin Thorsen Ranang](https://github.com/mtr), [Eirik Stavestrand](https://github.com/eirki): improvements to source code diff --git a/change_log.md b/change_log.md index 684866c..6aa13e0 100644 --- a/change_log.md +++ b/change_log.md @@ -1,3 +1,7 @@ +# 1.3.6 (github, pypi and conda 2026.xx.xx) +* Fixing #328, #336, #342, #344, #287, #307 +* Updated Readstat sources to 634f40a80d27221848ba57e9fb633b41146bac36 + # 1.3.5 (github, pypi and conda 2026.05.19) * Readstat sources updated to commit 3add3a5eaac6df24d938beffb9148792e362d9ef * date, datetime and time formats are now used without precision, decreasing the diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 564b1ea..7fafce8 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 82165eb..f421be6 100644 Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo index f8edd7e..780104b 100644 --- a/docs/_build/html/.buildinfo +++ b/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 52108008ddbffab0993edd96bc05016e +config: a3345b10b8e0a88133af8c5b09c01146 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/.buildinfo.bak b/docs/_build/html/.buildinfo.bak index 21da5c2..f8edd7e 100644 --- a/docs/_build/html/.buildinfo.bak +++ b/docs/_build/html/.buildinfo.bak @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: a00fbade8350e617c6a624dde88d788b +config: 52108008ddbffab0993edd96bc05016e tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/_sources/index.rst.txt b/docs/_build/html/_sources/index.rst.txt index f7abc8b..7b73a53 100644 --- a/docs/_build/html/_sources/index.rst.txt +++ b/docs/_build/html/_sources/index.rst.txt @@ -36,6 +36,8 @@ object contains the following fields: value_labels. Sas7bdat files may have this member populated and its information can be used to match the information in the value_labels coming from the sas7bcat file. * original_variable_types : a dict of variable name to variable format in the original file. For debugging purposes. + * original_variable_informats : a dict of variable name to variable SAS informat in the original file. For debugging purposes. + will be populated only for sas7bdat and xport files if available. * readstat_variable_types : a dict of variable name to variable type in the original file as extracted by Readstat.i For debugging purposes. In SAS and SPSS variables will be either double (numeric in the original app) or string (character). Stata has in addition int8, int32 and float types. diff --git a/docs/_build/html/_static/base-stemmer.js b/docs/_build/html/_static/base-stemmer.js new file mode 100644 index 0000000..e6fa0c4 --- /dev/null +++ b/docs/_build/html/_static/base-stemmer.js @@ -0,0 +1,476 @@ +// @ts-check + +/**@constructor*/ +BaseStemmer = function() { + /** @protected */ + this.current = ''; + this.cursor = 0; + this.limit = 0; + this.limit_backward = 0; + this.bra = 0; + this.ket = 0; + + /** + * @param {string} value + */ + this.setCurrent = function(value) { + this.current = value; + this.cursor = 0; + this.limit = this.current.length; + this.limit_backward = 0; + this.bra = this.cursor; + this.ket = this.limit; + }; + + /** + * @return {string} + */ + this.getCurrent = function() { + return this.current; + }; + + /** + * @param {BaseStemmer} other + */ + this.copy_from = function(other) { + /** @protected */ + this.current = other.current; + this.cursor = other.cursor; + this.limit = other.limit; + this.limit_backward = other.limit_backward; + this.bra = other.bra; + this.ket = other.ket; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.in_grouping = function(s, min, max) { + /** @protected */ + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor++; + return true; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_in_grouping = function(s, min, max) { + /** @protected */ + while (this.cursor < this.limit) { + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) + return true; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) + return true; + this.cursor++; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.in_grouping_b = function(s, min, max) { + /** @protected */ + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor--; + return true; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_in_grouping_b = function(s, min, max) { + /** @protected */ + while (this.cursor > this.limit_backward) { + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return true; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return true; + this.cursor--; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.out_grouping = function(s, min, max) { + /** @protected */ + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) { + this.cursor++; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) == 0) { + this.cursor++; + return true; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_out_grouping = function(s, min, max) { + /** @protected */ + while (this.cursor < this.limit) { + var ch = this.current.charCodeAt(this.cursor); + if (ch <= max && ch >= min) { + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) != 0) { + return true; + } + } + this.cursor++; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.out_grouping_b = function(s, min, max) { + /** @protected */ + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) { + this.cursor--; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) { + this.cursor--; + return true; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_out_grouping_b = function(s, min, max) { + /** @protected */ + while (this.cursor > this.limit_backward) { + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch <= max && ch >= min) { + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) != 0) { + return true; + } + } + this.cursor--; + } + return false; + }; + + /** + * @param {string} s + * @return {boolean} + */ + this.eq_s = function(s) + { + /** @protected */ + if (this.limit - this.cursor < s.length) return false; + if (this.current.slice(this.cursor, this.cursor + s.length) != s) + { + return false; + } + this.cursor += s.length; + return true; + }; + + /** + * @param {string} s + * @return {boolean} + */ + this.eq_s_b = function(s) + { + /** @protected */ + if (this.cursor - this.limit_backward < s.length) return false; + if (this.current.slice(this.cursor - s.length, this.cursor) != s) + { + return false; + } + this.cursor -= s.length; + return true; + }; + + /** + * @param {Among[]} v + * @return {number} + */ + this.find_among = function(v) + { + /** @protected */ + var i = 0; + var j = v.length; + + var c = this.cursor; + var l = this.limit; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >>> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; // smaller + // w[0]: string, w[1]: substring_i, w[2]: result, w[3]: function (optional) + var w = v[k]; + var i2; + for (i2 = common; i2 < w[0].length; i2++) + { + if (c + common == l) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c + common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; // v->s has been inspected + if (j == i) break; // only one item in v + + // - but now we need to go round once more to get + // v->s inspected. This looks messy, but is actually + // the optimal approach. + + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c + w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c + w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + // find_among_b is for backwards processing. Same comments apply + /** + * @param {Among[]} v + * @return {number} + */ + this.find_among_b = function(v) + { + /** @protected */ + var i = 0; + var j = v.length + + var c = this.cursor; + var lb = this.limit_backward; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; + var w = v[k]; + var i2; + for (i2 = w[0].length - 1 - common; i2 >= 0; i2--) + { + if (c - common == lb) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c - 1 - common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; + if (j == i) break; + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c - w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c - w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + /* to replace chars between c_bra and c_ket in this.current by the + * chars in s. + */ + /** + * @param {number} c_bra + * @param {number} c_ket + * @param {string} s + * @return {number} + */ + this.replace_s = function(c_bra, c_ket, s) + { + /** @protected */ + var adjustment = s.length - (c_ket - c_bra); + this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket); + this.limit += adjustment; + if (this.cursor >= c_ket) this.cursor += adjustment; + else if (this.cursor > c_bra) this.cursor = c_bra; + return adjustment; + }; + + /** + * @return {boolean} + */ + this.slice_check = function() + { + /** @protected */ + if (this.bra < 0 || + this.bra > this.ket || + this.ket > this.limit || + this.limit > this.current.length) + { + return false; + } + return true; + }; + + /** + * @param {number} c_bra + * @return {boolean} + */ + this.slice_from = function(s) + { + /** @protected */ + var result = false; + if (this.slice_check()) + { + this.replace_s(this.bra, this.ket, s); + result = true; + } + return result; + }; + + /** + * @return {boolean} + */ + this.slice_del = function() + { + /** @protected */ + return this.slice_from(""); + }; + + /** + * @param {number} c_bra + * @param {number} c_ket + * @param {string} s + */ + this.insert = function(c_bra, c_ket, s) + { + /** @protected */ + var adjustment = this.replace_s(c_bra, c_ket, s); + if (c_bra <= this.bra) this.bra += adjustment; + if (c_bra <= this.ket) this.ket += adjustment; + }; + + /** + * @return {string} + */ + this.slice_to = function() + { + /** @protected */ + var result = ''; + if (this.slice_check()) + { + result = this.current.slice(this.bra, this.ket); + } + return result; + }; + + /** + * @return {string} + */ + this.assign_to = function() + { + /** @protected */ + return this.current.slice(0, this.limit); + }; +}; diff --git a/docs/_build/html/_static/css/theme.css b/docs/_build/html/_static/css/theme.css index 0f14f10..a88467c 100644 --- a/docs/_build/html/_static/css/theme.css +++ b/docs/_build/html/_static/css/theme.css @@ -1,4 +1,4 @@ html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search .wy-dropdown>aactive,.wy-side-nav-search .wy-dropdown>afocus,.wy-side-nav-search>a:hover,.wy-side-nav-search>aactive,.wy-side-nav-search>afocus{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon,.wy-side-nav-search>a.icon{display:block}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.switch-menus{position:relative;display:block;margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-side-nav-search>div.switch-menus>div.language-switch,.wy-side-nav-search>div.switch-menus>div.version-switch{display:inline-block;padding:.2em}.wy-side-nav-search>div.switch-menus>div.language-switch select,.wy-side-nav-search>div.switch-menus>div.version-switch select{display:inline-block;margin-right:-2rem;padding-right:2rem;max-width:240px;text-align-last:center;background:none;border:none;border-radius:0;box-shadow:none;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-size:1em;font-weight:400;color:hsla(0,0%,100%,.3);cursor:pointer;appearance:none;-webkit-appearance:none;-moz-appearance:none}.wy-side-nav-search>div.switch-menus>div.language-switch select:active,.wy-side-nav-search>div.switch-menus>div.language-switch select:focus,.wy-side-nav-search>div.switch-menus>div.language-switch select:hover,.wy-side-nav-search>div.switch-menus>div.version-switch select:active,.wy-side-nav-search>div.switch-menus>div.version-switch select:focus,.wy-side-nav-search>div.switch-menus>div.version-switch select:hover{background:hsla(0,0%,100%,.1);color:hsla(0,0%,100%,.5)}.wy-side-nav-search>div.switch-menus>div.language-switch select option,.wy-side-nav-search>div.switch-menus>div.version-switch select option{color:#000}.wy-side-nav-search>div.switch-menus>div.language-switch:has(>select):after,.wy-side-nav-search>div.switch-menus>div.version-switch:has(>select):after{display:inline-block;width:1.5em;height:100%;padding:.1em;content:"\f0d7";font-size:1em;line-height:1.2em;font-family:FontAwesome;text-align:center;pointer-events:none;box-sizing:border-box}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search .wy-dropdown>aactive,.wy-side-nav-search .wy-dropdown>afocus,.wy-side-nav-search>a:hover,.wy-side-nav-search>aactive,.wy-side-nav-search>afocus{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon,.wy-side-nav-search>a.icon{display:block}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.switch-menus{position:relative;display:block;margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-side-nav-search>div.switch-menus>div.language-switch,.wy-side-nav-search>div.switch-menus>div.version-switch{display:inline-block;padding:.2em}.wy-side-nav-search>div.switch-menus>div.language-switch select,.wy-side-nav-search>div.switch-menus>div.version-switch select{display:inline-block;margin-right:-2rem;padding-right:2rem;max-width:240px;text-align-last:center;background:none;border:none;border-radius:0;box-shadow:none;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-size:1em;font-weight:400;color:hsla(0,0%,100%,.3);cursor:pointer;appearance:none;-webkit-appearance:none;-moz-appearance:none}.wy-side-nav-search>div.switch-menus>div.language-switch select:active,.wy-side-nav-search>div.switch-menus>div.language-switch select:focus,.wy-side-nav-search>div.switch-menus>div.language-switch select:hover,.wy-side-nav-search>div.switch-menus>div.version-switch select:active,.wy-side-nav-search>div.switch-menus>div.version-switch select:focus,.wy-side-nav-search>div.switch-menus>div.version-switch select:hover{background:hsla(0,0%,100%,.1);color:hsla(0,0%,100%,.5)}.wy-side-nav-search>div.switch-menus>div.language-switch select option,.wy-side-nav-search>div.switch-menus>div.version-switch select option{color:#000}.wy-side-nav-search>div.switch-menus>div.language-switch:has(>select):after,.wy-side-nav-search>div.switch-menus>div.version-switch:has(>select):after{display:inline-block;width:1.5em;height:100%;padding:.1em;content:"\f0d7";font-size:1em;line-height:1.2em;font-family:FontAwesome;text-align:center;pointer-events:none;box-sizing:border-box}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%;float:none;margin-left:0}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/docs/_build/html/_static/doctools.js b/docs/_build/html/_static/doctools.js index 0398ebb..807cdb1 100644 --- a/docs/_build/html/_static/doctools.js +++ b/docs/_build/html/_static/doctools.js @@ -59,7 +59,7 @@ const Documentation = { Object.assign(Documentation.TRANSLATIONS, catalog.messages); Documentation.PLURAL_EXPR = new Function( "n", - `return (${catalog.plural_expr})` + `return (${catalog.plural_expr})`, ); Documentation.LOCALE = catalog.locale; }, @@ -89,7 +89,7 @@ const Documentation = { const togglerElements = document.querySelectorAll("img.toggler"); togglerElements.forEach((el) => - el.addEventListener("click", (event) => toggler(event.currentTarget)) + el.addEventListener("click", (event) => toggler(event.currentTarget)), ); togglerElements.forEach((el) => (el.style.display = "")); if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); @@ -98,14 +98,15 @@ const Documentation = { initOnKeyListeners: () => { // only install a listener if it is really needed if ( - !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && - !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS + && !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS ) return; document.addEventListener("keydown", (event) => { // bail for input elements - if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) + return; // bail with special keys if (event.altKey || event.ctrlKey || event.metaKey) return; diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js index 14a4c29..f09a25b 100644 --- a/docs/_build/html/_static/documentation_options.js +++ b/docs/_build/html/_static/documentation_options.js @@ -1,5 +1,5 @@ const DOCUMENTATION_OPTIONS = { - VERSION: '1.3.4', + VERSION: '1.3.6', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/_build/html/_static/english-stemmer.js b/docs/_build/html/_static/english-stemmer.js new file mode 100644 index 0000000..056760e --- /dev/null +++ b/docs/_build/html/_static/english-stemmer.js @@ -0,0 +1,1066 @@ +// Generated from english.sbl by Snowball 3.0.1 - https://snowballstem.org/ + +/**@constructor*/ +var EnglishStemmer = function() { + var base = new BaseStemmer(); + + /** @const */ var a_0 = [ + ["arsen", -1, -1], + ["commun", -1, -1], + ["emerg", -1, -1], + ["gener", -1, -1], + ["later", -1, -1], + ["organ", -1, -1], + ["past", -1, -1], + ["univers", -1, -1] + ]; + + /** @const */ var a_1 = [ + ["'", -1, 1], + ["'s'", 0, 1], + ["'s", -1, 1] + ]; + + /** @const */ var a_2 = [ + ["ied", -1, 2], + ["s", -1, 3], + ["ies", 1, 2], + ["sses", 1, 1], + ["ss", 1, -1], + ["us", 1, -1] + ]; + + /** @const */ var a_3 = [ + ["succ", -1, 1], + ["proc", -1, 1], + ["exc", -1, 1] + ]; + + /** @const */ var a_4 = [ + ["even", -1, 2], + ["cann", -1, 2], + ["inn", -1, 2], + ["earr", -1, 2], + ["herr", -1, 2], + ["out", -1, 2], + ["y", -1, 1] + ]; + + /** @const */ var a_5 = [ + ["", -1, -1], + ["ed", 0, 2], + ["eed", 1, 1], + ["ing", 0, 3], + ["edly", 0, 2], + ["eedly", 4, 1], + ["ingly", 0, 2] + ]; + + /** @const */ var a_6 = [ + ["", -1, 3], + ["bb", 0, 2], + ["dd", 0, 2], + ["ff", 0, 2], + ["gg", 0, 2], + ["bl", 0, 1], + ["mm", 0, 2], + ["nn", 0, 2], + ["pp", 0, 2], + ["rr", 0, 2], + ["at", 0, 1], + ["tt", 0, 2], + ["iz", 0, 1] + ]; + + /** @const */ var a_7 = [ + ["anci", -1, 3], + ["enci", -1, 2], + ["ogi", -1, 14], + ["li", -1, 16], + ["bli", 3, 12], + ["abli", 4, 4], + ["alli", 3, 8], + ["fulli", 3, 9], + ["lessli", 3, 15], + ["ousli", 3, 10], + ["entli", 3, 5], + ["aliti", -1, 8], + ["biliti", -1, 12], + ["iviti", -1, 11], + ["tional", -1, 1], + ["ational", 14, 7], + ["alism", -1, 8], + ["ation", -1, 7], + ["ization", 17, 6], + ["izer", -1, 6], + ["ator", -1, 7], + ["iveness", -1, 11], + ["fulness", -1, 9], + ["ousness", -1, 10], + ["ogist", -1, 13] + ]; + + /** @const */ var a_8 = [ + ["icate", -1, 4], + ["ative", -1, 6], + ["alize", -1, 3], + ["iciti", -1, 4], + ["ical", -1, 4], + ["tional", -1, 1], + ["ational", 5, 2], + ["ful", -1, 5], + ["ness", -1, 5] + ]; + + /** @const */ var a_9 = [ + ["ic", -1, 1], + ["ance", -1, 1], + ["ence", -1, 1], + ["able", -1, 1], + ["ible", -1, 1], + ["ate", -1, 1], + ["ive", -1, 1], + ["ize", -1, 1], + ["iti", -1, 1], + ["al", -1, 1], + ["ism", -1, 1], + ["ion", -1, 2], + ["er", -1, 1], + ["ous", -1, 1], + ["ant", -1, 1], + ["ent", -1, 1], + ["ment", 15, 1], + ["ement", 16, 1] + ]; + + /** @const */ var a_10 = [ + ["e", -1, 1], + ["l", -1, 2] + ]; + + /** @const */ var a_11 = [ + ["andes", -1, -1], + ["atlas", -1, -1], + ["bias", -1, -1], + ["cosmos", -1, -1], + ["early", -1, 5], + ["gently", -1, 3], + ["howe", -1, -1], + ["idly", -1, 2], + ["news", -1, -1], + ["only", -1, 6], + ["singly", -1, 7], + ["skies", -1, 1], + ["sky", -1, -1], + ["ugly", -1, 4] + ]; + + /** @const */ var /** Array */ g_aeo = [17, 64]; + + /** @const */ var /** Array */ g_v = [17, 65, 16, 1]; + + /** @const */ var /** Array */ g_v_WXY = [1, 17, 65, 208, 1]; + + /** @const */ var /** Array */ g_valid_LI = [55, 141, 2]; + + var /** boolean */ B_Y_found = false; + var /** number */ I_p2 = 0; + var /** number */ I_p1 = 0; + + + /** @return {boolean} */ + function r_prelude() { + B_Y_found = false; + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + base.bra = base.cursor; + if (!(base.eq_s("'"))) + { + break lab0; + } + base.ket = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + base.cursor = v_1; + /** @const */ var /** number */ v_2 = base.cursor; + lab1: { + base.bra = base.cursor; + if (!(base.eq_s("y"))) + { + break lab1; + } + base.ket = base.cursor; + if (!base.slice_from("Y")) + { + return false; + } + B_Y_found = true; + } + base.cursor = v_2; + /** @const */ var /** number */ v_3 = base.cursor; + lab2: { + while(true) + { + /** @const */ var /** number */ v_4 = base.cursor; + lab3: { + golab4: while(true) + { + /** @const */ var /** number */ v_5 = base.cursor; + lab5: { + if (!(base.in_grouping(g_v, 97, 121))) + { + break lab5; + } + base.bra = base.cursor; + if (!(base.eq_s("y"))) + { + break lab5; + } + base.ket = base.cursor; + base.cursor = v_5; + break golab4; + } + base.cursor = v_5; + if (base.cursor >= base.limit) + { + break lab3; + } + base.cursor++; + } + if (!base.slice_from("Y")) + { + return false; + } + B_Y_found = true; + continue; + } + base.cursor = v_4; + break; + } + } + base.cursor = v_3; + return true; + }; + + /** @return {boolean} */ + function r_mark_regions() { + I_p1 = base.limit; + I_p2 = base.limit; + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + lab1: { + /** @const */ var /** number */ v_2 = base.cursor; + lab2: { + if (base.find_among(a_0) == 0) + { + break lab2; + } + break lab1; + } + base.cursor = v_2; + if (!base.go_out_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + if (!base.go_in_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + } + I_p1 = base.cursor; + if (!base.go_out_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + if (!base.go_in_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + I_p2 = base.cursor; + } + base.cursor = v_1; + return true; + }; + + /** @return {boolean} */ + function r_shortv() { + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.out_grouping_b(g_v_WXY, 89, 121))) + { + break lab1; + } + if (!(base.in_grouping_b(g_v, 97, 121))) + { + break lab1; + } + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + lab2: { + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab2; + } + if (!(base.in_grouping_b(g_v, 97, 121))) + { + break lab2; + } + if (base.cursor > base.limit_backward) + { + break lab2; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("past"))) + { + return false; + } + } + return true; + }; + + /** @return {boolean} */ + function r_R1() { + return I_p1 <= base.cursor; + }; + + /** @return {boolean} */ + function r_R2() { + return I_p2 <= base.cursor; + }; + + /** @return {boolean} */ + function r_Step_1a() { + var /** number */ among_var; + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab0: { + base.ket = base.cursor; + if (base.find_among_b(a_1) == 0) + { + base.cursor = base.limit - v_1; + break lab0; + } + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + base.ket = base.cursor; + among_var = base.find_among_b(a_2); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + if (!base.slice_from("ss")) + { + return false; + } + break; + case 2: + lab1: { + /** @const */ var /** number */ v_2 = base.limit - base.cursor; + lab2: { + { + /** @const */ var /** number */ c1 = base.cursor - 2; + if (c1 < base.limit_backward) + { + break lab2; + } + base.cursor = c1; + } + if (!base.slice_from("i")) + { + return false; + } + break lab1; + } + base.cursor = base.limit - v_2; + if (!base.slice_from("ie")) + { + return false; + } + } + break; + case 3: + if (base.cursor <= base.limit_backward) + { + return false; + } + base.cursor--; + if (!base.go_out_grouping_b(g_v, 97, 121)) + { + return false; + } + base.cursor--; + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_1b() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_5); + base.bra = base.cursor; + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + switch (among_var) { + case 1: + /** @const */ var /** number */ v_2 = base.limit - base.cursor; + lab2: { + lab3: { + /** @const */ var /** number */ v_3 = base.limit - base.cursor; + lab4: { + if (base.find_among_b(a_3) == 0) + { + break lab4; + } + if (base.cursor > base.limit_backward) + { + break lab4; + } + break lab3; + } + base.cursor = base.limit - v_3; + if (!r_R1()) + { + break lab2; + } + if (!base.slice_from("ee")) + { + return false; + } + } + } + base.cursor = base.limit - v_2; + break; + case 2: + break lab1; + case 3: + among_var = base.find_among_b(a_4); + if (among_var == 0) + { + break lab1; + } + switch (among_var) { + case 1: + /** @const */ var /** number */ v_4 = base.limit - base.cursor; + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab1; + } + if (base.cursor > base.limit_backward) + { + break lab1; + } + base.cursor = base.limit - v_4; + base.bra = base.cursor; + if (!base.slice_from("ie")) + { + return false; + } + break; + case 2: + if (base.cursor > base.limit_backward) + { + break lab1; + } + break; + } + break; + } + break lab0; + } + base.cursor = base.limit - v_1; + /** @const */ var /** number */ v_5 = base.limit - base.cursor; + if (!base.go_out_grouping_b(g_v, 97, 121)) + { + return false; + } + base.cursor--; + base.cursor = base.limit - v_5; + if (!base.slice_del()) + { + return false; + } + base.ket = base.cursor; + base.bra = base.cursor; + /** @const */ var /** number */ v_6 = base.limit - base.cursor; + among_var = base.find_among_b(a_6); + switch (among_var) { + case 1: + if (!base.slice_from("e")) + { + return false; + } + return false; + case 2: + { + /** @const */ var /** number */ v_7 = base.limit - base.cursor; + lab5: { + if (!(base.in_grouping_b(g_aeo, 97, 111))) + { + break lab5; + } + if (base.cursor > base.limit_backward) + { + break lab5; + } + return false; + } + base.cursor = base.limit - v_7; + } + break; + case 3: + if (base.cursor != I_p1) + { + return false; + } + /** @const */ var /** number */ v_8 = base.limit - base.cursor; + if (!r_shortv()) + { + return false; + } + base.cursor = base.limit - v_8; + if (!base.slice_from("e")) + { + return false; + } + return false; + } + base.cursor = base.limit - v_6; + base.ket = base.cursor; + if (base.cursor <= base.limit_backward) + { + return false; + } + base.cursor--; + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + return true; + }; + + /** @return {boolean} */ + function r_Step_1c() { + base.ket = base.cursor; + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.eq_s_b("y"))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("Y"))) + { + return false; + } + } + base.bra = base.cursor; + if (!(base.out_grouping_b(g_v, 97, 121))) + { + return false; + } + lab2: { + if (base.cursor > base.limit_backward) + { + break lab2; + } + return false; + } + if (!base.slice_from("i")) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_2() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_7); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R1()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("tion")) + { + return false; + } + break; + case 2: + if (!base.slice_from("ence")) + { + return false; + } + break; + case 3: + if (!base.slice_from("ance")) + { + return false; + } + break; + case 4: + if (!base.slice_from("able")) + { + return false; + } + break; + case 5: + if (!base.slice_from("ent")) + { + return false; + } + break; + case 6: + if (!base.slice_from("ize")) + { + return false; + } + break; + case 7: + if (!base.slice_from("ate")) + { + return false; + } + break; + case 8: + if (!base.slice_from("al")) + { + return false; + } + break; + case 9: + if (!base.slice_from("ful")) + { + return false; + } + break; + case 10: + if (!base.slice_from("ous")) + { + return false; + } + break; + case 11: + if (!base.slice_from("ive")) + { + return false; + } + break; + case 12: + if (!base.slice_from("ble")) + { + return false; + } + break; + case 13: + if (!base.slice_from("og")) + { + return false; + } + break; + case 14: + if (!(base.eq_s_b("l"))) + { + return false; + } + if (!base.slice_from("og")) + { + return false; + } + break; + case 15: + if (!base.slice_from("less")) + { + return false; + } + break; + case 16: + if (!(base.in_grouping_b(g_valid_LI, 99, 116))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_3() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_8); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R1()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("tion")) + { + return false; + } + break; + case 2: + if (!base.slice_from("ate")) + { + return false; + } + break; + case 3: + if (!base.slice_from("al")) + { + return false; + } + break; + case 4: + if (!base.slice_from("ic")) + { + return false; + } + break; + case 5: + if (!base.slice_del()) + { + return false; + } + break; + case 6: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_4() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_9); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R2()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_del()) + { + return false; + } + break; + case 2: + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.eq_s_b("s"))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("t"))) + { + return false; + } + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_5() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_10); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + lab0: { + lab1: { + if (!r_R2()) + { + break lab1; + } + break lab0; + } + if (!r_R1()) + { + return false; + } + { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab2: { + if (!r_shortv()) + { + break lab2; + } + return false; + } + base.cursor = base.limit - v_1; + } + } + if (!base.slice_del()) + { + return false; + } + break; + case 2: + if (!r_R2()) + { + return false; + } + if (!(base.eq_s_b("l"))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_exception1() { + var /** number */ among_var; + base.bra = base.cursor; + among_var = base.find_among(a_11); + if (among_var == 0) + { + return false; + } + base.ket = base.cursor; + if (base.cursor < base.limit) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("sky")) + { + return false; + } + break; + case 2: + if (!base.slice_from("idl")) + { + return false; + } + break; + case 3: + if (!base.slice_from("gentl")) + { + return false; + } + break; + case 4: + if (!base.slice_from("ugli")) + { + return false; + } + break; + case 5: + if (!base.slice_from("earli")) + { + return false; + } + break; + case 6: + if (!base.slice_from("onli")) + { + return false; + } + break; + case 7: + if (!base.slice_from("singl")) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_postlude() { + if (!B_Y_found) + { + return false; + } + while(true) + { + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + golab1: while(true) + { + /** @const */ var /** number */ v_2 = base.cursor; + lab2: { + base.bra = base.cursor; + if (!(base.eq_s("Y"))) + { + break lab2; + } + base.ket = base.cursor; + base.cursor = v_2; + break golab1; + } + base.cursor = v_2; + if (base.cursor >= base.limit) + { + break lab0; + } + base.cursor++; + } + if (!base.slice_from("y")) + { + return false; + } + continue; + } + base.cursor = v_1; + break; + } + return true; + }; + + this.stem = /** @return {boolean} */ function() { + lab0: { + /** @const */ var /** number */ v_1 = base.cursor; + lab1: { + if (!r_exception1()) + { + break lab1; + } + break lab0; + } + base.cursor = v_1; + lab2: { + { + /** @const */ var /** number */ v_2 = base.cursor; + lab3: { + { + /** @const */ var /** number */ c1 = base.cursor + 3; + if (c1 > base.limit) + { + break lab3; + } + base.cursor = c1; + } + break lab2; + } + base.cursor = v_2; + } + break lab0; + } + base.cursor = v_1; + r_prelude(); + r_mark_regions(); + base.limit_backward = base.cursor; base.cursor = base.limit; + /** @const */ var /** number */ v_3 = base.limit - base.cursor; + r_Step_1a(); + base.cursor = base.limit - v_3; + /** @const */ var /** number */ v_4 = base.limit - base.cursor; + r_Step_1b(); + base.cursor = base.limit - v_4; + /** @const */ var /** number */ v_5 = base.limit - base.cursor; + r_Step_1c(); + base.cursor = base.limit - v_5; + /** @const */ var /** number */ v_6 = base.limit - base.cursor; + r_Step_2(); + base.cursor = base.limit - v_6; + /** @const */ var /** number */ v_7 = base.limit - base.cursor; + r_Step_3(); + base.cursor = base.limit - v_7; + /** @const */ var /** number */ v_8 = base.limit - base.cursor; + r_Step_4(); + base.cursor = base.limit - v_8; + /** @const */ var /** number */ v_9 = base.limit - base.cursor; + r_Step_5(); + base.cursor = base.limit - v_9; + base.cursor = base.limit_backward; + /** @const */ var /** number */ v_10 = base.cursor; + r_postlude(); + base.cursor = v_10; + } + return true; + }; + + /**@return{string}*/ + this['stemWord'] = function(/**string*/word) { + base.setCurrent(word); + this.stem(); + return base.getCurrent(); + }; +}; diff --git a/docs/_build/html/_static/language_data.js b/docs/_build/html/_static/language_data.js index c7fe6c6..5776786 100644 --- a/docs/_build/html/_static/language_data.js +++ b/docs/_build/html/_static/language_data.js @@ -1,192 +1,13 @@ /* * This script contains the language-specific data used by searchtools.js, - * namely the list of stopwords, stemmer, scorer and splitter. + * namely the set of stopwords, stemmer, scorer and splitter. */ -var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; +const stopwords = new Set(["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"]); +window.stopwords = stopwords; // Export to global scope -/* Non-minified version is copied as a separate JS file, if available */ - -/** - * Porter Stemmer - */ -var Stemmer = function() { - - var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' - }; - - var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' - }; - - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence - - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem - - this.stemWord = function (w) { - var stem; - var suffix; - var firstch; - var origword = w; - - if (w.length < 3) - return w; - - var re; - var re2; - var re3; - var re4; - - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); - - // Step 1a - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); - - // Step 1b - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - var fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re,""); - } - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; - else if (re3.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; - } - } - - // Step 1c - re = /^(.+?)y$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; - } - - // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; - } - - // Step 3 - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; - } - - // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; - } - - // Step 5 - re = /^(.+?)e$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; - } - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - - // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); - return w; - } -} - +/* Non-minified versions are copied as separate JavaScript files, if available */ +BaseStemmer=function(){this.current="",this.cursor=0,this.limit=0,this.limit_backward=0,this.bra=0,this.ket=0,this.setCurrent=function(t){this.current=t,this.cursor=0,this.limit=this.current.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},this.getCurrent=function(){return this.current},this.copy_from=function(t){this.current=t.current,this.cursor=t.cursor,this.limit=t.limit,this.limit_backward=t.limit_backward,this.bra=t.bra,this.ket=t.ket},this.in_grouping=function(t,r,i){return!(this.cursor>=this.limit||i<(i=this.current.charCodeAt(this.cursor))||i>>3]&1<<(7&i))||(this.cursor++,0))},this.go_in_grouping=function(t,r,i){for(;this.cursor>>3]&1<<(7&s)))return!0;this.cursor++}return!1},this.in_grouping_b=function(t,r,i){return!(this.cursor<=this.limit_backward||i<(i=this.current.charCodeAt(this.cursor-1))||i>>3]&1<<(7&i))||(this.cursor--,0))},this.go_in_grouping_b=function(t,r,i){for(;this.cursor>this.limit_backward;){var s=this.current.charCodeAt(this.cursor-1);if(i>>3]&1<<(7&s)))return!0;this.cursor--}return!1},this.out_grouping=function(t,r,i){return!(this.cursor>=this.limit)&&(i<(i=this.current.charCodeAt(this.cursor))||i>>3]&1<<(7&i)))&&(this.cursor++,!0)},this.go_out_grouping=function(t,r,i){for(;this.cursor>>3]&1<<(7&s)))return!0;this.cursor++}return!1},this.out_grouping_b=function(t,r,i){return!(this.cursor<=this.limit_backward)&&(i<(i=this.current.charCodeAt(this.cursor-1))||i>>3]&1<<(7&i)))&&(this.cursor--,!0)},this.go_out_grouping_b=function(t,r,i){for(;this.cursor>this.limit_backward;){var s=this.current.charCodeAt(this.cursor-1);if(s<=i&&r<=s&&0!=(t[(s-=r)>>>3]&1<<(7&s)))return!0;this.cursor--}return!1},this.eq_s=function(t){return!(this.limit-this.cursor>>1),o=0,a=e=(l=t[r])[0].length){if(this.cursor=s+l[0].length,l.length<4)return l[2];var g=l[3](this);if(this.cursor=s+l[0].length,g)return l[2]}}while(0<=(r=l[1]));return 0},this.find_among_b=function(t){for(var r=0,i=t.length,s=this.cursor,h=this.limit_backward,e=0,n=0,c=!1;;){for(var u,o=r+(i-r>>1),a=0,l=e=(u=t[r])[0].length){if(this.cursor=s-u[0].length,u.length<4)return u[2];var g=u[3](this);if(this.cursor=s-u[0].length,g)return u[2]}}while(0<=(r=u[1]));return 0},this.replace_s=function(t,r,i){var s=i.length-(r-t);return this.current=this.current.slice(0,t)+i+this.current.slice(r),this.limit+=s,this.cursor>=r?this.cursor+=s:this.cursor>t&&(this.cursor=t),s},this.slice_check=function(){return!(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>this.current.length)},this.slice_from=function(t){var r=!1;return this.slice_check()&&(this.replace_s(this.bra,this.ket,t),r=!0),r},this.slice_del=function(){return this.slice_from("")},this.insert=function(t,r,i){r=this.replace_s(t,r,i);t<=this.bra&&(this.bra+=r),t<=this.ket&&(this.ket+=r)},this.slice_to=function(){var t="";return t=this.slice_check()?this.current.slice(this.bra,this.ket):t},this.assign_to=function(){return this.current.slice(0,this.limit)}}; +var EnglishStemmer=function(){var a=new BaseStemmer,c=[["arsen",-1,-1],["commun",-1,-1],["emerg",-1,-1],["gener",-1,-1],["later",-1,-1],["organ",-1,-1],["past",-1,-1],["univers",-1,-1]],o=[["'",-1,1],["'s'",0,1],["'s",-1,1]],u=[["ied",-1,2],["s",-1,3],["ies",1,2],["sses",1,1],["ss",1,-1],["us",1,-1]],t=[["succ",-1,1],["proc",-1,1],["exc",-1,1]],l=[["even",-1,2],["cann",-1,2],["inn",-1,2],["earr",-1,2],["herr",-1,2],["out",-1,2],["y",-1,1]],n=[["",-1,-1],["ed",0,2],["eed",1,1],["ing",0,3],["edly",0,2],["eedly",4,1],["ingly",0,2]],f=[["",-1,3],["bb",0,2],["dd",0,2],["ff",0,2],["gg",0,2],["bl",0,1],["mm",0,2],["nn",0,2],["pp",0,2],["rr",0,2],["at",0,1],["tt",0,2],["iz",0,1]],_=[["anci",-1,3],["enci",-1,2],["ogi",-1,14],["li",-1,16],["bli",3,12],["abli",4,4],["alli",3,8],["fulli",3,9],["lessli",3,15],["ousli",3,10],["entli",3,5],["aliti",-1,8],["biliti",-1,12],["iviti",-1,11],["tional",-1,1],["ational",14,7],["alism",-1,8],["ation",-1,7],["ization",17,6],["izer",-1,6],["ator",-1,7],["iveness",-1,11],["fulness",-1,9],["ousness",-1,10],["ogist",-1,13]],m=[["icate",-1,4],["ative",-1,6],["alize",-1,3],["iciti",-1,4],["ical",-1,4],["tional",-1,1],["ational",5,2],["ful",-1,5],["ness",-1,5]],b=[["ic",-1,1],["ance",-1,1],["ence",-1,1],["able",-1,1],["ible",-1,1],["ate",-1,1],["ive",-1,1],["ize",-1,1],["iti",-1,1],["al",-1,1],["ism",-1,1],["ion",-1,2],["er",-1,1],["ous",-1,1],["ant",-1,1],["ent",-1,1],["ment",15,1],["ement",16,1]],k=[["e",-1,1],["l",-1,2]],g=[["andes",-1,-1],["atlas",-1,-1],["bias",-1,-1],["cosmos",-1,-1],["early",-1,5],["gently",-1,3],["howe",-1,-1],["idly",-1,2],["news",-1,-1],["only",-1,6],["singly",-1,7],["skies",-1,1],["sky",-1,-1],["ugly",-1,4]],d=[17,64],v=[17,65,16,1],i=[1,17,65,208,1],w=[55,141,2],p=!1,y=0,h=0;function q(){var r=a.limit-a.cursor;return!!(a.out_grouping_b(i,89,121)&&a.in_grouping_b(v,97,121)&&a.out_grouping_b(v,97,121)||(a.cursor=a.limit-r,a.out_grouping_b(v,97,121)&&a.in_grouping_b(v,97,121)&&!(a.cursor>a.limit_backward))||(a.cursor=a.limit-r,a.eq_s_b("past")))}function z(){return h<=a.cursor}function Y(){return y<=a.cursor}this.stem=function(){var r=a.cursor;if(!(()=>{var r;if(a.bra=a.cursor,0!=(r=a.find_among(g))&&(a.ket=a.cursor,!(a.cursora.limit)a.cursor=i;else{a.cursor=e,a.cursor=r,(()=>{p=!1;var r=a.cursor;if(a.bra=a.cursor,!a.eq_s("'")||(a.ket=a.cursor,a.slice_del())){a.cursor=r;r=a.cursor;if(a.bra=a.cursor,a.eq_s("y")){if(a.ket=a.cursor,!a.slice_from("Y"))return;p=!0}a.cursor=r;for(r=a.cursor;;){var i=a.cursor;r:{for(;;){var e=a.cursor;if(a.in_grouping(v,97,121)&&(a.bra=a.cursor,a.eq_s("y"))){a.ket=a.cursor,a.cursor=e;break}if(a.cursor=e,a.cursor>=a.limit)break r;a.cursor++}if(!a.slice_from("Y"))return;p=!0;continue}a.cursor=i;break}a.cursor=r}})(),h=a.limit,y=a.limit;i=a.cursor;r:{var s=a.cursor;if(0==a.find_among(c)){if(a.cursor=s,!a.go_out_grouping(v,97,121))break r;if(a.cursor++,!a.go_in_grouping(v,97,121))break r;a.cursor++}h=a.cursor,a.go_out_grouping(v,97,121)&&(a.cursor++,a.go_in_grouping(v,97,121))&&(a.cursor++,y=a.cursor)}a.cursor=i,a.limit_backward=a.cursor,a.cursor=a.limit;var e=a.limit-a.cursor,r=((()=>{var r=a.limit-a.cursor;if(a.ket=a.cursor,0==a.find_among_b(o))a.cursor=a.limit-r;else if(a.bra=a.cursor,!a.slice_del())return;if(a.ket=a.cursor,0!=(r=a.find_among_b(u)))switch(a.bra=a.cursor,r){case 1:if(a.slice_from("ss"))break;return;case 2:r:{var i=a.limit-a.cursor,e=a.cursor-2;if(!(e{a.ket=a.cursor,o=a.find_among_b(n),a.bra=a.cursor;r:{var r=a.limit-a.cursor;i:{switch(o){case 1:var i=a.limit-a.cursor;e:{var e=a.limit-a.cursor;if(0==a.find_among_b(t)||a.cursor>a.limit_backward){if(a.cursor=a.limit-e,!z())break e;if(!a.slice_from("ee"))return}}a.cursor=a.limit-i;break;case 2:break i;case 3:if(0==(o=a.find_among_b(l)))break i;switch(o){case 1:var s=a.limit-a.cursor;if(!a.out_grouping_b(v,97,121))break i;if(a.cursor>a.limit_backward)break i;if(a.cursor=a.limit-s,a.bra=a.cursor,a.slice_from("ie"))break;return;case 2:if(a.cursor>a.limit_backward)break i}}break r}a.cursor=a.limit-r;var c=a.limit-a.cursor;if(!a.go_out_grouping_b(v,97,121))return;if(a.cursor--,a.cursor=a.limit-c,!a.slice_del())return;a.ket=a.cursor,a.bra=a.cursor;var o,c=a.limit-a.cursor;switch(o=a.find_among_b(f)){case 1:return a.slice_from("e");case 2:var u=a.limit-a.cursor;if(a.in_grouping_b(d,97,111)&&!(a.cursor>a.limit_backward))return;a.cursor=a.limit-u;break;case 3:return a.cursor!=h||(u=a.limit-a.cursor,q()&&(a.cursor=a.limit-u,a.slice_from("e")))}if(a.cursor=a.limit-c,a.ket=a.cursor,a.cursor<=a.limit_backward)return;if(a.cursor--,a.bra=a.cursor,!a.slice_del())return}})(),a.cursor=a.limit-r,a.limit-a.cursor),r=(a.ket=a.cursor,e=a.limit-a.cursor,(a.eq_s_b("y")||(a.cursor=a.limit-e,a.eq_s_b("Y")))&&(a.bra=a.cursor,a.out_grouping_b(v,97,121))&&a.cursor>a.limit_backward&&a.slice_from("i"),a.cursor=a.limit-i,a.limit-a.cursor),e=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(_))&&(a.bra=a.cursor,z()))switch(r){case 1:if(a.slice_from("tion"))break;return;case 2:if(a.slice_from("ence"))break;return;case 3:if(a.slice_from("ance"))break;return;case 4:if(a.slice_from("able"))break;return;case 5:if(a.slice_from("ent"))break;return;case 6:if(a.slice_from("ize"))break;return;case 7:if(a.slice_from("ate"))break;return;case 8:if(a.slice_from("al"))break;return;case 9:if(a.slice_from("ful"))break;return;case 10:if(a.slice_from("ous"))break;return;case 11:if(a.slice_from("ive"))break;return;case 12:if(a.slice_from("ble"))break;return;case 13:if(a.slice_from("og"))break;return;case 14:if(!a.eq_s_b("l"))return;if(a.slice_from("og"))break;return;case 15:if(a.slice_from("less"))break;return;case 16:if(!a.in_grouping_b(w,99,116))return;if(a.slice_del())break}})(),a.cursor=a.limit-r,a.limit-a.cursor),i=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(m))&&(a.bra=a.cursor,z()))switch(r){case 1:if(a.slice_from("tion"))break;return;case 2:if(a.slice_from("ate"))break;return;case 3:if(a.slice_from("al"))break;return;case 4:if(a.slice_from("ic"))break;return;case 5:if(a.slice_del())break;return;case 6:if(!Y())return;if(a.slice_del())break}})(),a.cursor=a.limit-e,a.limit-a.cursor),r=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(b))&&(a.bra=a.cursor,Y()))switch(r){case 1:if(a.slice_del())break;return;case 2:var i=a.limit-a.cursor;if(!a.eq_s_b("s")&&(a.cursor=a.limit-i,!a.eq_s_b("t")))return;if(a.slice_del())break}})(),a.cursor=a.limit-i,a.limit-a.cursor),e=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(k)))switch(a.bra=a.cursor,r){case 1:if(!Y()){if(!z())return;var i=a.limit-a.cursor;if(q())return;a.cursor=a.limit-i}if(a.slice_del())break;return;case 2:if(!Y())return;if(!a.eq_s_b("l"))return;if(a.slice_del())break}})(),a.cursor=a.limit-r,a.cursor=a.limit_backward,a.cursor);(()=>{if(p)for(;;){var r=a.cursor;r:{for(;;){var i=a.cursor;if(a.bra=a.cursor,a.eq_s("Y")){a.ket=a.cursor,a.cursor=i;break}if(a.cursor=i,a.cursor>=a.limit)break r;a.cursor++}if(a.slice_from("y"))continue;return}a.cursor=r;break}})(),a.cursor=e}}return!0},this.stemWord=function(r){return a.setCurrent(r),this.stem(),a.getCurrent()}}; +window.Stemmer = EnglishStemmer; diff --git a/docs/_build/html/_static/searchtools.js b/docs/_build/html/_static/searchtools.js index 91f4be5..e29b1c7 100644 --- a/docs/_build/html/_static/searchtools.js +++ b/docs/_build/html/_static/searchtools.js @@ -41,11 +41,12 @@ if (typeof Scorer === "undefined") { } // Global search result kind enum, used by themes to style search results. +// prettier-ignore class SearchResultKind { - static get index() { return "index"; } - static get object() { return "object"; } - static get text() { return "text"; } - static get title() { return "title"; } + static get index() { return "index"; } + static get object() { return "object"; } + static get text() { return "text"; } + static get title() { return "title"; } } const _removeChildren = (element) => { @@ -58,6 +59,15 @@ const _removeChildren = (element) => { const _escapeRegExp = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string +const _escapeHTML = (text) => { + return text + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """) + .replaceAll("'", "'"); +}; + const _displayItem = (item, searchTerms, highlightTerms) => { const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; @@ -90,25 +100,30 @@ const _displayItem = (item, searchTerms, highlightTerms) => { let linkEl = listItem.appendChild(document.createElement("a")); linkEl.href = linkUrl + anchor; linkEl.dataset.score = score; - linkEl.innerHTML = title; + linkEl.innerHTML = _escapeHTML(title); if (descr) { listItem.appendChild(document.createElement("span")).innerHTML = - " (" + descr + ")"; + ` (${_escapeHTML(descr)})`; // highlight search terms in the description - if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js - highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); - } - else if (showSearchSummary) + if (SPHINX_HIGHLIGHT_ENABLED) + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + highlightTerms.forEach((term) => + _highlightText(listItem, term, "highlighted"), + ); + } else if (showSearchSummary) fetch(requestUrl) .then((responseData) => responseData.text()) .then((data) => { if (data) listItem.appendChild( - Search.makeSearchSummary(data, searchTerms, anchor) + Search.makeSearchSummary(data, searchTerms, anchor), ); // highlight search terms in the summary - if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js - highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + if (SPHINX_HIGHLIGHT_ENABLED) + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + highlightTerms.forEach((term) => + _highlightText(listItem, term, "highlighted"), + ); }); Search.output.appendChild(listItem); }; @@ -117,14 +132,14 @@ const _finishSearch = (resultCount) => { Search.title.innerText = _("Search Results"); if (!resultCount) Search.status.innerText = Documentation.gettext( - "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.", ); else Search.status.innerText = Documentation.ngettext( "Search finished, found one page matching the search query.", "Search finished, found ${resultCount} pages matching the search query.", resultCount, - ).replace('${resultCount}', resultCount); + ).replace("${resultCount}", resultCount); }; const _displayNextItem = ( results, @@ -138,7 +153,7 @@ const _displayNextItem = ( _displayItem(results.pop(), searchTerms, highlightTerms); setTimeout( () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), - 5 + 5, ); } // search finished, update title and status message @@ -170,9 +185,10 @@ const _orderResultsByScoreThenName = (a, b) => { * This is the same as ``\W+`` in Python, preserving the surrogate pair area. */ if (typeof splitQuery === "undefined") { - var splitQuery = (query) => query + var splitQuery = (query) => + query .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) - .filter(term => term) // remove remaining empty strings + .filter((term) => term); // remove remaining empty strings } /** @@ -184,16 +200,23 @@ const Search = { _pulse_status: -1, htmlToText: (htmlString, anchor) => { - const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + const htmlElement = new DOMParser().parseFromString( + htmlString, + "text/html", + ); for (const removalQuery of [".headerlink", "script", "style"]) { - htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + htmlElement.querySelectorAll(removalQuery).forEach((el) => { + el.remove(); + }); } if (anchor) { - const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + const anchorContent = htmlElement.querySelector( + `[role="main"] ${anchor}`, + ); if (anchorContent) return anchorContent.textContent; console.warn( - `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.`, ); } @@ -202,7 +225,7 @@ const Search = { if (docContent) return docContent.textContent; console.warn( - "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template.", ); return ""; }, @@ -287,12 +310,8 @@ const Search = { const queryTermLower = queryTerm.toLowerCase(); // maybe skip this "word" - // stopwords array is from language_data.js - if ( - stopwords.indexOf(queryTermLower) !== -1 || - queryTerm.match(/^\d+$/) - ) - return; + // stopwords set is from language_data.js + if (stopwords.has(queryTermLower) || queryTerm.match(/^\d+$/)) return; // stem the word let word = stemmer.stemWord(queryTermLower); @@ -304,8 +323,12 @@ const Search = { } }); - if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js - localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + if (SPHINX_HIGHLIGHT_ENABLED) { + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + localStorage.setItem( + "sphinx_highlight_terms", + [...highlightTerms].join(" "), + ); } // console.debug("SEARCH: searching for:"); @@ -318,7 +341,13 @@ const Search = { /** * execute search (requires search index to be loaded) */ - _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + _performSearch: ( + query, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ) => { const filenames = Search._index.filenames; const docNames = Search._index.docnames; const titles = Search._index.titles; @@ -334,10 +363,15 @@ const Search = { const queryLower = query.toLowerCase().trim(); for (const [title, foundTitles] of Object.entries(allTitles)) { - if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + if ( + title.toLowerCase().trim().includes(queryLower) + && queryLower.length >= title.length / 2 + ) { for (const [file, id] of foundTitles) { - const score = Math.round(Scorer.title * queryLower.length / title.length); - const boost = titles[file] === title ? 1 : 0; // add a boost for document titles + const score = Math.round( + (Scorer.title * queryLower.length) / title.length, + ); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles normalResults.push([ docNames[file], titles[file] !== title ? `${titles[file]} > ${title}` : title, @@ -353,9 +387,9 @@ const Search = { // search for explicit entries in index directives for (const [entry, foundEntries] of Object.entries(indexEntries)) { - if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + if (entry.includes(queryLower) && queryLower.length >= entry.length / 2) { for (const [file, id, isMain] of foundEntries) { - const score = Math.round(100 * queryLower.length / entry.length); + const score = Math.round((100 * queryLower.length) / entry.length); const result = [ docNames[file], titles[file], @@ -376,11 +410,13 @@ const Search = { // lookup as object objectTerms.forEach((term) => - normalResults.push(...Search.performObjectSearch(term, objectTerms)) + normalResults.push(...Search.performObjectSearch(term, objectTerms)), ); // lookup as search terms in fulltext - normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + normalResults.push( + ...Search.performTermsSearch(searchTerms, excludedTerms), + ); // let the scorer override scores with a custom scoring function if (Scorer.score) { @@ -401,7 +437,11 @@ const Search = { // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept let seen = new Set(); results = results.reverse().reduce((acc, result) => { - let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + let resultStr = result + .slice(0, 4) + .concat([result[5]]) + .map((v) => String(v)) + .join(","); if (!seen.has(resultStr)) { acc.push(result); seen.add(resultStr); @@ -413,8 +453,20 @@ const Search = { }, query: (query) => { - const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); - const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + const [ + searchQuery, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ] = Search._parseQuery(query); + const results = Search._performSearch( + searchQuery, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ); // for debugging //Search.lastresults = results.slice(); // a copy @@ -437,7 +489,7 @@ const Search = { const results = []; const objectSearchCallback = (prefix, match) => { - const name = match[4] + const name = match[4]; const fullname = (prefix ? prefix + "." : "") + name; const fullnameLower = fullname.toLowerCase(); if (fullnameLower.indexOf(object) < 0) return; @@ -489,9 +541,7 @@ const Search = { ]); }; Object.keys(objects).forEach((prefix) => - objects[prefix].forEach((array) => - objectSearchCallback(prefix, array) - ) + objects[prefix].forEach((array) => objectSearchCallback(prefix, array)), ); return results; }, @@ -516,8 +566,14 @@ const Search = { // find documents, if any, containing the query word in their text/title term indices // use Object.hasOwnProperty to avoid mismatching against prototype properties const arr = [ - { files: terms.hasOwnProperty(word) ? terms[word] : undefined, score: Scorer.term }, - { files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, score: Scorer.title }, + { + files: terms.hasOwnProperty(word) ? terms[word] : undefined, + score: Scorer.term, + }, + { + files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, + score: Scorer.title, + }, ]; // add support for partial matches if (word.length > 2) { @@ -558,7 +614,8 @@ const Search = { // create the mapping files.forEach((file) => { if (!fileMap.has(file)) fileMap.set(file, [word]); - else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + else if (fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); }); }); @@ -569,11 +626,11 @@ const Search = { // as search terms with length < 3 are discarded const filteredTermCount = [...searchTerms].filter( - (term) => term.length > 2 + (term) => term.length > 2, ).length; if ( - wordList.length !== searchTerms.size && - wordList.length !== filteredTermCount + wordList.length !== searchTerms.size + && wordList.length !== filteredTermCount ) continue; @@ -581,10 +638,10 @@ const Search = { if ( [...excludedTerms].some( (term) => - terms[term] === file || - titleTerms[term] === file || - (terms[term] || []).includes(file) || - (titleTerms[term] || []).includes(file) + terms[term] === file + || titleTerms[term] === file + || (terms[term] || []).includes(file) + || (titleTerms[term] || []).includes(file), ) ) break; @@ -626,7 +683,8 @@ const Search = { let summary = document.createElement("p"); summary.classList.add("context"); - summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + summary.textContent = + top + text.substr(startWithContext, 240).trim() + tail; return summary; }, diff --git a/docs/_build/html/_static/sphinx_highlight.js b/docs/_build/html/_static/sphinx_highlight.js index 8a96c69..a74e103 100644 --- a/docs/_build/html/_static/sphinx_highlight.js +++ b/docs/_build/html/_static/sphinx_highlight.js @@ -1,7 +1,7 @@ /* Highlighting utilities for Sphinx HTML documentation. */ "use strict"; -const SPHINX_HIGHLIGHT_ENABLED = true +const SPHINX_HIGHLIGHT_ENABLED = true; /** * highlight a given string on a node by wrapping it in @@ -13,9 +13,9 @@ const _highlight = (node, addItems, text, className) => { const parent = node.parentNode; const pos = val.toLowerCase().indexOf(text); if ( - pos >= 0 && - !parent.classList.contains(className) && - !parent.classList.contains("nohighlight") + pos >= 0 + && !parent.classList.contains(className) + && !parent.classList.contains("nohighlight") ) { let span; @@ -30,13 +30,7 @@ const _highlight = (node, addItems, text, className) => { span.appendChild(document.createTextNode(val.substr(pos, text.length))); const rest = document.createTextNode(val.substr(pos + text.length)); - parent.insertBefore( - span, - parent.insertBefore( - rest, - node.nextSibling - ) - ); + parent.insertBefore(span, parent.insertBefore(rest, node.nextSibling)); node.nodeValue = val.substr(0, pos); /* There may be more occurrences of search term in this node. So call this * function recursively on the remaining fragment. @@ -46,7 +40,7 @@ const _highlight = (node, addItems, text, className) => { if (isInSVG) { const rect = document.createElementNS( "http://www.w3.org/2000/svg", - "rect" + "rect", ); const bbox = parent.getBBox(); rect.x.baseVal.value = bbox.x; @@ -65,7 +59,7 @@ const _highlightText = (thisNode, text, className) => { let addItems = []; _highlight(thisNode, addItems, text, className); addItems.forEach((obj) => - obj.parent.insertAdjacentElement("beforebegin", obj.target) + obj.parent.insertAdjacentElement("beforebegin", obj.target), ); }; @@ -73,25 +67,31 @@ const _highlightText = (thisNode, text, className) => { * Small JavaScript module for the documentation. */ const SphinxHighlight = { - /** * highlight the search words provided in localstorage in the text */ highlightSearchWords: () => { - if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight // get and clear terms from localstorage const url = new URL(window.location); const highlight = - localStorage.getItem("sphinx_highlight_terms") - || url.searchParams.get("highlight") - || ""; - localStorage.removeItem("sphinx_highlight_terms") - url.searchParams.delete("highlight"); - window.history.replaceState({}, "", url); + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms"); + // Update history only if '?highlight' is present; otherwise it + // clears text fragments (not set in window.location by the browser) + if (url.searchParams.has("highlight")) { + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + } // get individual terms from highlight string - const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + const terms = highlight + .toLowerCase() + .split(/\s+/) + .filter((x) => x); if (terms.length === 0) return; // nothing to do // There should never be more than one element matching "div.body" @@ -107,11 +107,11 @@ const SphinxHighlight = { document .createRange() .createContextualFragment( - '" - ) + '", + ), ); }, @@ -125,7 +125,7 @@ const SphinxHighlight = { document .querySelectorAll("span.highlighted") .forEach((el) => el.classList.remove("highlighted")); - localStorage.removeItem("sphinx_highlight_terms") + localStorage.removeItem("sphinx_highlight_terms"); }, initEscapeListener: () => { @@ -134,10 +134,15 @@ const SphinxHighlight = { document.addEventListener("keydown", (event) => { // bail for input elements - if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) + return; // bail with special keys - if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; - if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) + return; + if ( + DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + && event.key === "Escape" + ) { SphinxHighlight.hideSearchWords(); event.preventDefault(); } diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 8c6027c..554b99b 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -5,14 +5,14 @@ - Index — pyreadstat 1.3.4 documentation + Index — pyreadstat 1.3.6 documentation - + - - - + + + diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index fa5566b..7f7c57f 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -6,14 +6,14 @@ - Welcome to pyreadstat’s documentation! — pyreadstat 1.3.4 documentation + Welcome to pyreadstat’s documentation! — pyreadstat 1.3.6 documentation - + - - - + + + @@ -120,6 +120,8 @@

Metadata Object Description

Functions Documentation

-class pyreadstat.pyreadstat.FileLike(*args, **kwargs)
+class pyreadstat.pyreadstat.FileLike(*args, **kwargs)

Protocol for file-like objects accepted by pyreadstat

@@ -627,7 +629,7 @@

Metadata Object Description
-pyreadstat.pyreadstat.write_xport(df: DataFrame, dst_path: str | bytes | PathLike[str] | PathLike[bytes], file_label: str = '', column_labels: list[str] | dict[str, str] | None = None, table_name: str | None = None, file_format_version: Literal[5, 8] = 8, variable_format: dict[str, str] | None = None) None
+pyreadstat.pyreadstat.write_xport(df: DataFrame, dst_path: str | bytes | PathLike[str] | PathLike[bytes], file_label: str = '', column_labels: list[str] | dict[str, str] | None = None, table_name: str | None = None, file_format_version: Literal[5, 8] = 8, variable_format: dict[str, str] | None = None, variable_informat: dict[str, str] | None = None) None

Writes a dataframe to a SAS Xport (xpt) file. If no table_name is specified the dataset has by default the name DATASET (take it into account if reading the file from SAS.) @@ -647,6 +649,8 @@

Metadata Object Description - Python Module Index — pyreadstat 1.3.4 documentation + Python Module Index — pyreadstat 1.3.6 documentation - + - - - + + + diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html index 23a3602..6026b99 100644 --- a/docs/_build/html/search.html +++ b/docs/_build/html/search.html @@ -5,15 +5,15 @@ - Search — pyreadstat 1.3.4 documentation + Search — pyreadstat 1.3.6 documentation - + - - - + + + diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 7685121..1f7b10b 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles":{"Functions Documentation":[[0,"module-pyreadstat.pyreadstat"]],"Indices and tables":[[0,"indices-and-tables"]],"Metadata Object Description":[[0,"metadata-object-description"]],"Welcome to pyreadstat\u2019s documentation!":[[0,null]]},"docnames":["index"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2},"filenames":["index.rst"],"indexentries":{"filelike (class in pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.FileLike",false]],"module":[[0,"module-pyreadstat.pyreadstat",false]],"pyreadstat.pyreadstat":[[0,"module-pyreadstat.pyreadstat",false]],"read() (pyreadstat.pyreadstat.filelike method)":[[0,"pyreadstat.pyreadstat.FileLike.read",false]],"read_dta() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_dta",false]],"read_file_in_chunks() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_file_in_chunks",false]],"read_file_multiprocessing() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_file_multiprocessing",false]],"read_por() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_por",false]],"read_sas7bcat() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_sas7bcat",false]],"read_sas7bdat() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_sas7bdat",false]],"read_sav() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_sav",false]],"read_xport() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_xport",false]],"seek() (pyreadstat.pyreadstat.filelike method)":[[0,"pyreadstat.pyreadstat.FileLike.seek",false]],"write_dta() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_dta",false]],"write_por() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_por",false]],"write_sav() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_sav",false]],"write_xport() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_xport",false]]},"objects":{"pyreadstat":[[0,0,0,"-","pyreadstat"]],"pyreadstat.pyreadstat":[[0,1,1,"","FileLike"],[0,3,1,"","read_dta"],[0,3,1,"","read_file_in_chunks"],[0,3,1,"","read_file_multiprocessing"],[0,3,1,"","read_por"],[0,3,1,"","read_sas7bcat"],[0,3,1,"","read_sas7bdat"],[0,3,1,"","read_sav"],[0,3,1,"","read_xport"],[0,3,1,"","write_dta"],[0,3,1,"","write_por"],[0,3,1,"","write_sav"],[0,3,1,"","write_xport"]],"pyreadstat.pyreadstat.FileLike":[[0,2,1,"","read"],[0,2,1,"","seek"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:function"},"terms":{"0":0,"000":0,"1":0,"10":0,"100000":0,"15":0,"2":0,"3":0,"4":0,"5":0,"7":0,"8":0,"A":0,"By":0,"For":0,"IF":0,"If":0,"In":0,"It":0,"That":0,"The":0,"There":0,"Will":0,"_":0,"abl":0,"about":0,"accept":0,"accordingli":[],"account":0,"actual":0,"ad":0,"add":0,"addit":0,"after":0,"align":0,"all":0,"allow":0,"also":0,"altough":[],"alwai":0,"an":0,"ani":0,"annot":0,"anyth":0,"app":0,"appear":0,"appli":0,"applic":0,"apply_value_format":0,"appropi":0,"ar":0,"arg":0,"argument":0,"arrai":0,"assum":0,"attach":0,"attempt":0,"avoid":0,"base":0,"befor":0,"behavior":0,"being":0,"between":0,"beyond":0,"bool":0,"boolean":0,"both":0,"boundari":0,"byte":0,"can":0,"cannot":0,"canot":0,"case":0,"catalog":0,"catalog_fil":0,"categori":0,"center":0,"certain":0,"chang":0,"charact":0,"chunk":0,"chunksiz":0,"class":0,"column":0,"column_label":0,"column_nam":0,"column_names_to_label":0,"combin":0,"come":0,"compat":0,"compos":0,"compress":0,"comput":0,"consid":0,"consist":0,"contain":0,"convers":0,"convert":0,"core":0,"correct":0,"could":0,"counted_valu":0,"creation":0,"creation_tim":0,"current":0,"data":0,"data_fram":0,"datafram":0,"dataset":0,"date":0,"dates_as_pandas_datetim":0,"datetim":0,"datetime64":0,"deal":0,"debug":0,"default":0,"defect":0,"defin":0,"definit":0,"deliv":0,"describ":0,"determin":0,"df":0,"dict":0,"dictionari":0,"dictonari":0,"did":0,"difficult":0,"directli":0,"disabl":0,"disable_datetime_convers":0,"discard":0,"discret":0,"displai":0,"do":0,"done":0,"doubl":0,"dst_path":0,"dta":0,"each":0,"effect":0,"either":0,"element":0,"empti":0,"encod":0,"entri":0,"enum":0,"equal":0,"error":0,"etc":0,"even":0,"exist":0,"extra":0,"extra_date_format":0,"extra_datetime_format":0,"extra_time_format":0,"extract":0,"fals":0,"faster":0,"field":0,"file":0,"file_encod":0,"file_format_vers":0,"file_label":0,"file_path":0,"filelik":0,"filename_path":0,"first":0,"float":0,"follow":0,"form":0,"format":0,"formats_as_categori":0,"formats_as_ordered_categori":0,"found":0,"frame":0,"from":0,"full":0,"gener":0,"get":0,"given":0,"guess":0,"ha":0,"happen":0,"have":0,"help":0,"her":0,"here":0,"hi":0,"higher":0,"how":0,"i":0,"iconv":0,"ignor":0,"impact":0,"import":0,"includ":0,"independ":0,"index":0,"inform":0,"instead":0,"int":0,"int32":0,"int8":0,"integ":0,"interpret":0,"irrespect":0,"is_dichotomi":0,"iter":0,"its":0,"kei":0,"keyword":0,"kwarg":0,"label":0,"larger":0,"later":0,"left":0,"length":0,"like":0,"limit":0,"list":0,"liter":0,"lo":0,"look":0,"lower":0,"mai":0,"mani":0,"map":0,"match":0,"max":0,"maximum":0,"mean":0,"measur":0,"medatata":0,"member":0,"metadata_contain":0,"metadataonli":0,"min":0,"miss":0,"missing_rang":0,"missing_user_valu":0,"missingrang":0,"modif":0,"modification_tim":0,"modul":0,"more":0,"mr":0,"mr_set":0,"multipl":0,"multiprocess":0,"must":0,"name":0,"nan":0,"need":0,"next":0,"nomin":0,"non":0,"none":0,"note":0,"notic":0,"num_process":0,"num_row":0,"number":0,"number_column":0,"number_row":0,"numer":0,"numpi":0,"obligatori":0,"obtain":0,"offset":0,"one":0,"ones":0,"onli":0,"option":0,"order":0,"ordin":0,"origin":0,"original_variable_typ":0,"other":0,"otherwis":0,"output_format":0,"output_paramet":[],"over":0,"overcom":0,"overflow":0,"page":0,"panda":0,"pandasdatafram":0,"parallel":0,"paramet":0,"pars":0,"pass":0,"path":0,"pathlib":[],"pathlik":0,"per":0,"perform":0,"piec":0,"po":0,"polar":0,"polarsdatafram":0,"popul":0,"por":0,"preced":0,"prefer":0,"present":0,"process":0,"protocol":0,"purpos":0,"pyreadstatreadfunct":0,"python":0,"rang":0,"read":0,"read_dta":0,"read_file_in_chunk":0,"read_file_multiprocess":0,"read_funct":0,"read_por":0,"read_sas7bcat":0,"read_sas7bdat":0,"read_sav":0,"read_xport":0,"readabl":0,"readm":0,"readstat":0,"readstat_variable_typ":0,"record":0,"remain":0,"replac":0,"report":0,"repres":0,"respons":0,"result":0,"return":0,"right":0,"rise":0,"row":0,"row_compress":0,"row_limit":0,"row_offset":0,"run":0,"sa":0,"same":0,"sas7bcat":0,"sas7bdat":0,"sata":0,"sav":0,"scale":0,"search":0,"section":0,"see":0,"seek":0,"sensit":0,"set":0,"set_catalog_to_sa":0,"set_value_label":0,"sever":0,"singl":0,"situat":0,"size":0,"skip":0,"so":0,"some":0,"spawn":0,"specif":0,"specifi":0,"speed":0,"spss":0,"start":0,"stata":0,"stop":0,"storag":0,"store":0,"str":0,"strang":0,"string":0,"suppli":0,"support":0,"system":0,"table_nam":0,"take":0,"text":0,"than":0,"thei":0,"them":0,"therefor":0,"thi":0,"those":0,"time":0,"transform":0,"true":0,"tupl":0,"two":0,"type":0,"unknown":0,"unless":0,"unlimit":0,"up":0,"upper":0,"us":0,"usecol":0,"user":0,"user_miss":0,"utf":0,"valid":0,"valu":0,"value_label":0,"variabl":0,"variable_align":0,"variable_display_width":0,"variable_format":0,"variable_list":0,"variable_measur":0,"variable_storage_width":0,"variable_to_label":0,"variable_value_label":0,"variables_value_label":0,"version":0,"wa":0,"warn":0,"well":0,"were":0,"when":0,"whenc":0,"where":0,"which":0,"whole":0,"whose":0,"width":0,"without":0,"work":0,"worker":0,"write":0,"write_dta":0,"write_por":0,"write_sav":0,"write_xport":0,"written":0,"xport":0,"xpt":0,"year":0,"yield":0,"you":0,"z":0,"zsav":0},"titles":["Welcome to pyreadstat\u2019s documentation!"],"titleterms":{"":0,"descript":0,"document":0,"function":0,"indic":0,"metadata":0,"object":0,"pyreadstat":0,"tabl":0,"welcom":0}}) \ No newline at end of file +Search.setIndex({"alltitles":{"Functions Documentation":[[0,"module-pyreadstat.pyreadstat"]],"Indices and tables":[[0,"indices-and-tables"]],"Metadata Object Description":[[0,"metadata-object-description"]],"Welcome to pyreadstat\u2019s documentation!":[[0,null]]},"docnames":["index"],"envversion":{"sphinx":66,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2},"filenames":["index.rst"],"indexentries":{"filelike (class in pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.FileLike",false]],"module":[[0,"module-pyreadstat.pyreadstat",false]],"pyreadstat.pyreadstat":[[0,"module-pyreadstat.pyreadstat",false]],"read() (pyreadstat.pyreadstat.filelike method)":[[0,"pyreadstat.pyreadstat.FileLike.read",false]],"read_dta() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_dta",false]],"read_file_in_chunks() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_file_in_chunks",false]],"read_file_multiprocessing() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_file_multiprocessing",false]],"read_por() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_por",false]],"read_sas7bcat() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_sas7bcat",false]],"read_sas7bdat() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_sas7bdat",false]],"read_sav() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_sav",false]],"read_xport() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.read_xport",false]],"seek() (pyreadstat.pyreadstat.filelike method)":[[0,"pyreadstat.pyreadstat.FileLike.seek",false]],"write_dta() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_dta",false]],"write_por() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_por",false]],"write_sav() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_sav",false]],"write_xport() (in module pyreadstat.pyreadstat)":[[0,"pyreadstat.pyreadstat.write_xport",false]]},"objects":{"pyreadstat":[[0,0,0,"-","pyreadstat"]],"pyreadstat.pyreadstat":[[0,1,1,"","FileLike"],[0,3,1,"","read_dta"],[0,3,1,"","read_file_in_chunks"],[0,3,1,"","read_file_multiprocessing"],[0,3,1,"","read_por"],[0,3,1,"","read_sas7bcat"],[0,3,1,"","read_sas7bdat"],[0,3,1,"","read_sav"],[0,3,1,"","read_xport"],[0,3,1,"","write_dta"],[0,3,1,"","write_por"],[0,3,1,"","write_sav"],[0,3,1,"","write_xport"]],"pyreadstat.pyreadstat.FileLike":[[0,2,1,"","read"],[0,2,1,"","seek"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:function"},"terms":{"A":0,"By":0,"Each":0,"For":0,"IF":0,"If":0,"In":0,"It":0,"That":0,"The":0,"There":0,"This":0,"When":0,"You":0,"_":0,"abl":0,"accept":0,"account":0,"actual":0,"add":0,"addit":0,"align":0,"allow":0,"also":0,"alway":0,"ani":0,"annot":0,"anyth":0,"app":0,"appear":0,"appli":0,"applic":0,"apply_value_format":0,"appropi":0,"arg":0,"argument":0,"array":0,"assum":0,"attach":0,"attempt":0,"avail":0,"avoid":0,"base":0,"befor":0,"behavior":0,"beyond":0,"bool":0,"boolean":0,"boundari":0,"byte":0,"can":0,"canot":0,"case":0,"catalog":0,"catalog_fil":0,"categori":0,"center":0,"certain":0,"chang":0,"charact":0,"chunk":0,"chunksiz":0,"class":0,"column":0,"column_label":0,"column_nam":0,"column_names_to_label":0,"combin":0,"come":0,"compat":0,"compos":0,"compress":0,"comput":0,"consid":0,"consist":0,"contain":0,"convers":0,"convert":0,"core":0,"correct":0,"counted_valu":0,"creation":0,"creation_tim":0,"current":0,"data":0,"data_fram":0,"datafram":0,"dataset":0,"date":0,"dates_as_pandas_datetim":0,"datetim":0,"datetime64":0,"deal":0,"debug":0,"default":0,"defect":0,"defin":0,"definit":0,"deliv":0,"describ":0,"determin":0,"df":0,"dict":0,"dictionari":0,"dictonari":0,"difficult":0,"direct":0,"disabl":0,"disable_datetime_convers":0,"discard":0,"discret":0,"display":0,"done":0,"doubl":0,"dst_path":0,"dta":0,"effect":0,"either":0,"element":0,"empti":0,"encod":0,"entri":0,"enum":0,"equal":0,"error":0,"etc":0,"even":0,"exist":0,"extra":0,"extra_date_format":0,"extra_datetime_format":0,"extra_time_format":0,"extract":0,"fals":0,"faster":0,"field":0,"file":0,"file_encod":0,"file_format_vers":0,"file_label":0,"file_path":0,"filelik":0,"filename_path":0,"first":0,"float":0,"follow":0,"form":0,"format":0,"formats_as_categori":0,"formats_as_ordered_categori":0,"found":0,"frame":0,"full":0,"generat":0,"get":0,"given":0,"guess":0,"happen":0,"help":0,"hi":0,"higher":0,"iconv":0,"ignor":0,"impact":0,"import":0,"includ":0,"independ":0,"index":0,"inform":0,"informat":0,"instead":0,"int":0,"int32":0,"int8":0,"integ":0,"interpret":0,"irrespect":0,"is_dichotomi":0,"iter":0,"key":0,"keyword":0,"kwarg":0,"label":0,"larger":0,"later":0,"left":0,"length":0,"like":0,"limit":0,"list":0,"liter":0,"lo":0,"look":0,"lower":0,"mani":0,"map":0,"match":0,"max":0,"maximum":0,"may":0,"mean":0,"measur":0,"medatata":0,"member":0,"metadata_contain":0,"metadataon":0,"min":0,"miss":0,"missing_rang":0,"missing_user_valu":0,"missingrang":0,"modif":0,"modification_tim":0,"modul":0,"mr":0,"mr_set":0,"multipl":0,"multiprocess":0,"must":0,"name":0,"nan":0,"need":0,"next":0,"nomin":0,"non":0,"none":0,"note":0,"notic":0,"num_process":0,"num_row":0,"number":0,"number_column":0,"number_row":0,"numer":0,"numpi":0,"obligatori":0,"obtain":0,"offset":0,"one":0,"onli":0,"option":0,"order":0,"ordin":0,"origin":0,"original_variable_informat":0,"original_variable_typ":0,"otherwis":0,"output_format":0,"overcom":0,"overflow":0,"page":0,"panda":0,"pandasdatafram":0,"parallel":0,"paramet":0,"pars":0,"pass":0,"path":0,"pathlik":0,"per":0,"perform":0,"piec":0,"polar":0,"polarsdatafram":0,"popul":0,"por":0,"pos":0,"preced":0,"prefer":0,"present":0,"process":0,"protocol":0,"purpos":0,"pyreadstatreadfunct":0,"python":0,"rang":0,"read":0,"read_dta":0,"read_file_in_chunk":0,"read_file_multiprocess":0,"read_funct":0,"read_por":0,"read_sas7bcat":0,"read_sas7bdat":0,"read_sav":0,"read_xport":0,"readabl":0,"readm":0,"readstat":0,"readstat_variable_typ":0,"record":0,"remain":0,"replac":0,"report":0,"repres":0,"respons":0,"result":0,"return":0,"right":0,"rise":0,"row":0,"row_compress":0,"row_limit":0,"row_offset":0,"run":0,"sas":0,"sas7bcat":0,"sas7bdat":0,"sata":0,"sav":0,"scale":0,"search":0,"section":0,"see":0,"seek":0,"sensit":0,"set":0,"set_catalog_to_sa":0,"set_value_label":0,"sever":0,"singl":0,"situat":0,"size":0,"skip":0,"spawn":0,"specif":0,"specifi":0,"speed":0,"spss":0,"start":0,"stata":0,"stop":0,"storag":0,"store":0,"str":0,"strang":0,"string":0,"suppli":0,"support":0,"system":0,"table_nam":0,"take":0,"text":0,"therefor":0,"time":0,"transform":0,"true":0,"tupl":0,"two":0,"type":0,"unknown":0,"unless":0,"unlimit":0,"upper":0,"use":0,"usecol":0,"user":0,"user_miss":0,"utf":0,"valid":0,"valu":0,"value_label":0,"variabl":0,"variable_align":0,"variable_display_width":0,"variable_format":0,"variable_informat":0,"variable_list":0,"variable_measur":0,"variable_storage_width":0,"variable_to_label":0,"variable_value_label":0,"variables_value_label":0,"version":0,"warn":0,"well":0,"whenc":0,"whole":0,"whose":0,"width":0,"will":0,"without":0,"work":0,"worker":0,"write":0,"write_dta":0,"write_por":0,"write_sav":0,"write_xport":0,"written":0,"xport":0,"xpt":0,"year":0,"yield":0,"z":0,"zsav":0},"titles":["Welcome to pyreadstat\u2019s documentation!"],"titleterms":{"descript":0,"document":0,"function":0,"indic":0,"metadata":0,"object":0,"pyreadstat":0,"s":0,"tabl":0,"welcom":0}}) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 6aae15a..78b57f4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '' # The full version, including alpha/beta/rc tags -release = '1.3.5' +release = '1.3.6' # -- General configuration --------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index f7abc8b..7b73a53 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -36,6 +36,8 @@ object contains the following fields: value_labels. Sas7bdat files may have this member populated and its information can be used to match the information in the value_labels coming from the sas7bcat file. * original_variable_types : a dict of variable name to variable format in the original file. For debugging purposes. + * original_variable_informats : a dict of variable name to variable SAS informat in the original file. For debugging purposes. + will be populated only for sas7bdat and xport files if available. * readstat_variable_types : a dict of variable name to variable type in the original file as extracted by Readstat.i For debugging purposes. In SAS and SPSS variables will be either double (numeric in the original app) or string (character). Stata has in addition int8, int32 and float types. diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index a3ecd0e..e86b45f 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -22,7 +22,7 @@ from ._readstat_parser import ReadstatError, PyreadstatError from .pyfunctions import set_value_labels, set_catalog_to_sas -__version__ = "1.3.5" +__version__ = "1.3.6" __all__ = ( "read_sav", diff --git a/pyreadstat/_readstat_parser.c b/pyreadstat/_readstat_parser.c index dd4d4e2..96e566e 100644 --- a/pyreadstat/_readstat_parser.c +++ b/pyreadstat/_readstat_parser.c @@ -1740,7 +1740,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "pyreadstat/_readstat_parser.pyx":916 +/* "pyreadstat/_readstat_parser.pyx":922 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -1774,6 +1774,7 @@ struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container { PyObject *col_dytpes_isfloat; PyObject *col_formats; PyObject *col_formats_original; + PyObject *col_informats_original; PyObject *origin; double unix_to_origin_secs; __pyx_t_10pyreadstat_16_readstat_parser_py_file_format file_format; @@ -3016,7 +3017,6 @@ static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_format_regex = 0; static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix = 0; static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix = 0; static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix = 0; -static PyObject *__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx = 0; static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format); /*proto*/ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format, double, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, PyObject *, int, PyObject *, double); /*proto*/ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_metadata_t *, void *); /*proto*/ @@ -3092,7 +3092,7 @@ typedef struct { PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[1]; PyObject *__pyx_codeobj_tab[3]; - PyObject *__pyx_string_tab[295]; + PyObject *__pyx_string_tab[296]; PyObject *__pyx_number_tab[4]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ @@ -3354,81 +3354,82 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_nw __pyx_string_tab[217] #define __pyx_n_u_object __pyx_string_tab[218] #define __pyx_n_u_ordinal __pyx_string_tab[219] -#define __pyx_n_u_original_variable_types __pyx_string_tab[220] -#define __pyx_n_u_os __pyx_string_tab[221] -#define __pyx_n_u_output_format __pyx_string_tab[222] -#define __pyx_n_u_pandas __pyx_string_tab[223] -#define __pyx_n_u_parser_entry_point __pyx_string_tab[224] -#define __pyx_n_u_parser_format __pyx_string_tab[225] -#define __pyx_n_u_path __pyx_string_tab[226] -#define __pyx_n_u_polars __pyx_string_tab[227] -#define __pyx_n_u_pop __pyx_string_tab[228] -#define __pyx_n_u_por __pyx_string_tab[229] -#define __pyx_n_u_prepare __pyx_string_tab[230] -#define __pyx_n_u_pyclasses __pyx_string_tab[231] -#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[232] -#define __pyx_n_u_pyx_capi __pyx_string_tab[233] -#define __pyx_n_u_pyx_state __pyx_string_tab[234] -#define __pyx_n_u_qualname __pyx_string_tab[235] -#define __pyx_n_u_re __pyx_string_tab[236] -#define __pyx_n_u_read __pyx_string_tab[237] -#define __pyx_n_u_readstat_variable_types __pyx_string_tab[238] -#define __pyx_n_u_reduce __pyx_string_tab[239] -#define __pyx_n_u_reduce_cython __pyx_string_tab[240] -#define __pyx_n_u_reduce_ex __pyx_string_tab[241] -#define __pyx_n_u_right __pyx_string_tab[242] -#define __pyx_n_u_round __pyx_string_tab[243] -#define __pyx_n_u_row_limit __pyx_string_tab[244] -#define __pyx_n_u_row_offset __pyx_string_tab[245] -#define __pyx_n_u_sas7bcat __pyx_string_tab[246] -#define __pyx_n_u_sas7bdat __pyx_string_tab[247] -#define __pyx_n_u_scale __pyx_string_tab[248] -#define __pyx_n_u_schema __pyx_string_tab[249] -#define __pyx_n_u_seek __pyx_string_tab[250] -#define __pyx_n_u_self __pyx_string_tab[251] -#define __pyx_n_u_set_name __pyx_string_tab[252] -#define __pyx_n_u_setdefault __pyx_string_tab[253] -#define __pyx_n_u_setstate __pyx_string_tab[254] -#define __pyx_n_u_setstate_cython __pyx_string_tab[255] -#define __pyx_n_u_stable __pyx_string_tab[256] -#define __pyx_n_u_string __pyx_string_tab[257] -#define __pyx_n_u_surrogateescape __pyx_string_tab[258] -#define __pyx_n_u_sys __pyx_string_tab[259] -#define __pyx_n_u_table_name __pyx_string_tab[260] -#define __pyx_n_u_tell __pyx_string_tab[261] -#define __pyx_n_u_test __pyx_string_tab[262] -#define __pyx_n_u_time __pyx_string_tab[263] -#define __pyx_n_u_time_unit __pyx_string_tab[264] -#define __pyx_n_u_to_datetime __pyx_string_tab[265] -#define __pyx_n_u_to_native __pyx_string_tab[266] -#define __pyx_n_u_tolist __pyx_string_tab[267] -#define __pyx_n_u_type __pyx_string_tab[268] -#define __pyx_n_u_undetermined __pyx_string_tab[269] -#define __pyx_n_u_unknown __pyx_string_tab[270] -#define __pyx_n_u_us __pyx_string_tab[271] -#define __pyx_n_u_usecols __pyx_string_tab[272] -#define __pyx_n_u_user_missing __pyx_string_tab[273] -#define __pyx_n_u_usernan __pyx_string_tab[274] -#define __pyx_n_u_v2 __pyx_string_tab[275] -#define __pyx_n_u_value_labels __pyx_string_tab[276] -#define __pyx_n_u_values __pyx_string_tab[277] -#define __pyx_n_u_variable_alignment __pyx_string_tab[278] -#define __pyx_n_u_variable_display_width __pyx_string_tab[279] -#define __pyx_n_u_variable_list __pyx_string_tab[280] -#define __pyx_n_u_variable_measure __pyx_string_tab[281] -#define __pyx_n_u_variable_storage_width __pyx_string_tab[282] -#define __pyx_n_u_variable_to_label __pyx_string_tab[283] -#define __pyx_n_u_variable_value_labels __pyx_string_tab[284] -#define __pyx_n_u_warn __pyx_string_tab[285] -#define __pyx_n_u_warnings __pyx_string_tab[286] -#define __pyx_n_u_with_columns __pyx_string_tab[287] -#define __pyx_n_u_xport __pyx_string_tab[288] -#define __pyx_n_u_zip __pyx_string_tab[289] -#define __pyx_kp_b_ __pyx_string_tab[290] -#define __pyx_kp_b_PyObject_PyObject___pyx_t_10pyre __pyx_string_tab[291] -#define __pyx_kp_b_PyObject_readstat_to_numpy_types __pyx_string_tab[292] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[293] -#define __pyx_kp_b_iso88591_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a __pyx_string_tab[294] +#define __pyx_n_u_original_variable_informats __pyx_string_tab[220] +#define __pyx_n_u_original_variable_types __pyx_string_tab[221] +#define __pyx_n_u_os __pyx_string_tab[222] +#define __pyx_n_u_output_format __pyx_string_tab[223] +#define __pyx_n_u_pandas __pyx_string_tab[224] +#define __pyx_n_u_parser_entry_point __pyx_string_tab[225] +#define __pyx_n_u_parser_format __pyx_string_tab[226] +#define __pyx_n_u_path __pyx_string_tab[227] +#define __pyx_n_u_polars __pyx_string_tab[228] +#define __pyx_n_u_pop __pyx_string_tab[229] +#define __pyx_n_u_por __pyx_string_tab[230] +#define __pyx_n_u_prepare __pyx_string_tab[231] +#define __pyx_n_u_pyclasses __pyx_string_tab[232] +#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[233] +#define __pyx_n_u_pyx_capi __pyx_string_tab[234] +#define __pyx_n_u_pyx_state __pyx_string_tab[235] +#define __pyx_n_u_qualname __pyx_string_tab[236] +#define __pyx_n_u_re __pyx_string_tab[237] +#define __pyx_n_u_read __pyx_string_tab[238] +#define __pyx_n_u_readstat_variable_types __pyx_string_tab[239] +#define __pyx_n_u_reduce __pyx_string_tab[240] +#define __pyx_n_u_reduce_cython __pyx_string_tab[241] +#define __pyx_n_u_reduce_ex __pyx_string_tab[242] +#define __pyx_n_u_right __pyx_string_tab[243] +#define __pyx_n_u_round __pyx_string_tab[244] +#define __pyx_n_u_row_limit __pyx_string_tab[245] +#define __pyx_n_u_row_offset __pyx_string_tab[246] +#define __pyx_n_u_sas7bcat __pyx_string_tab[247] +#define __pyx_n_u_sas7bdat __pyx_string_tab[248] +#define __pyx_n_u_scale __pyx_string_tab[249] +#define __pyx_n_u_schema __pyx_string_tab[250] +#define __pyx_n_u_seek __pyx_string_tab[251] +#define __pyx_n_u_self __pyx_string_tab[252] +#define __pyx_n_u_set_name __pyx_string_tab[253] +#define __pyx_n_u_setdefault __pyx_string_tab[254] +#define __pyx_n_u_setstate __pyx_string_tab[255] +#define __pyx_n_u_setstate_cython __pyx_string_tab[256] +#define __pyx_n_u_stable __pyx_string_tab[257] +#define __pyx_n_u_string __pyx_string_tab[258] +#define __pyx_n_u_surrogateescape __pyx_string_tab[259] +#define __pyx_n_u_sys __pyx_string_tab[260] +#define __pyx_n_u_table_name __pyx_string_tab[261] +#define __pyx_n_u_tell __pyx_string_tab[262] +#define __pyx_n_u_test __pyx_string_tab[263] +#define __pyx_n_u_time __pyx_string_tab[264] +#define __pyx_n_u_time_unit __pyx_string_tab[265] +#define __pyx_n_u_to_datetime __pyx_string_tab[266] +#define __pyx_n_u_to_native __pyx_string_tab[267] +#define __pyx_n_u_tolist __pyx_string_tab[268] +#define __pyx_n_u_type __pyx_string_tab[269] +#define __pyx_n_u_undetermined __pyx_string_tab[270] +#define __pyx_n_u_unknown __pyx_string_tab[271] +#define __pyx_n_u_us __pyx_string_tab[272] +#define __pyx_n_u_usecols __pyx_string_tab[273] +#define __pyx_n_u_user_missing __pyx_string_tab[274] +#define __pyx_n_u_usernan __pyx_string_tab[275] +#define __pyx_n_u_v2 __pyx_string_tab[276] +#define __pyx_n_u_value_labels __pyx_string_tab[277] +#define __pyx_n_u_values __pyx_string_tab[278] +#define __pyx_n_u_variable_alignment __pyx_string_tab[279] +#define __pyx_n_u_variable_display_width __pyx_string_tab[280] +#define __pyx_n_u_variable_list __pyx_string_tab[281] +#define __pyx_n_u_variable_measure __pyx_string_tab[282] +#define __pyx_n_u_variable_storage_width __pyx_string_tab[283] +#define __pyx_n_u_variable_to_label __pyx_string_tab[284] +#define __pyx_n_u_variable_value_labels __pyx_string_tab[285] +#define __pyx_n_u_warn __pyx_string_tab[286] +#define __pyx_n_u_warnings __pyx_string_tab[287] +#define __pyx_n_u_with_columns __pyx_string_tab[288] +#define __pyx_n_u_xport __pyx_string_tab[289] +#define __pyx_n_u_zip __pyx_string_tab[290] +#define __pyx_kp_b_ __pyx_string_tab[291] +#define __pyx_kp_b_PyObject_PyObject___pyx_t_10pyre __pyx_string_tab[292] +#define __pyx_kp_b_PyObject_readstat_to_numpy_types __pyx_string_tab[293] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[294] +#define __pyx_kp_b_iso88591_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a __pyx_string_tab[295] #define __pyx_float_1e6 __pyx_number_tab[0] #define __pyx_int_0 __pyx_number_tab[1] #define __pyx_int_1 __pyx_number_tab[2] @@ -3458,7 +3459,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<295; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<296; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_clear_contents ### */ /* CommonTypesMetaclass.module_state_clear */ @@ -3493,7 +3494,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<295; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<296; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_traverse_contents ### */ /* CommonTypesMetaclass.module_state_traverse */ @@ -5725,7 +5726,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s * self.col_dytpes_isfloat = list() * self.col_formats = list() # <<<<<<<<<<<<<< * self.col_formats_original = list() - * self.origin = None + * self.col_informats_original = list() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5739,8 +5740,8 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s * self.col_dytpes_isfloat = list() * self.col_formats = list() * self.col_formats_original = list() # <<<<<<<<<<<<<< + * self.col_informats_original = list() * self.origin = None - * self.unix_to_origin_secs = 0 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5753,6 +5754,21 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s /* "pyreadstat/_readstat_parser.pyx":104 * self.col_formats = list() * self.col_formats_original = list() + * self.col_informats_original = list() # <<<<<<<<<<<<<< + * self.origin = None + * self.unix_to_origin_secs = 0 +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->col_informats_original); + __Pyx_DECREF(__pyx_v_self->col_informats_original); + __pyx_v_self->col_informats_original = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_parser.pyx":105 + * self.col_formats_original = list() + * self.col_informats_original = list() * self.origin = None # <<<<<<<<<<<<<< * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 @@ -5763,8 +5779,8 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->origin); __pyx_v_self->origin = Py_None; - /* "pyreadstat/_readstat_parser.pyx":105 - * self.col_formats_original = list() + /* "pyreadstat/_readstat_parser.pyx":106 + * self.col_informats_original = list() * self.origin = None * self.unix_to_origin_secs = 0 # <<<<<<<<<<<<<< * self.is_unkown_number_rows = 0 @@ -5772,7 +5788,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->unix_to_origin_secs = 0.0; - /* "pyreadstat/_readstat_parser.pyx":106 + /* "pyreadstat/_readstat_parser.pyx":107 * self.origin = None * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 # <<<<<<<<<<<<<< @@ -5781,7 +5797,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->is_unkown_number_rows = 0; - /* "pyreadstat/_readstat_parser.pyx":107 + /* "pyreadstat/_readstat_parser.pyx":108 * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 * self.file_encoding = None # <<<<<<<<<<<<<< @@ -5794,7 +5810,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->file_encoding); __pyx_v_self->file_encoding = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":108 + /* "pyreadstat/_readstat_parser.pyx":109 * self.is_unkown_number_rows = 0 * self.file_encoding = None * self.file_label = None # <<<<<<<<<<<<<< @@ -5807,7 +5823,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->file_label); __pyx_v_self->file_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":109 + /* "pyreadstat/_readstat_parser.pyx":110 * self.file_encoding = None * self.file_label = None * self.metaonly = 0 # <<<<<<<<<<<<<< @@ -5816,7 +5832,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->metaonly = 0; - /* "pyreadstat/_readstat_parser.pyx":110 + /* "pyreadstat/_readstat_parser.pyx":111 * self.file_label = None * self.metaonly = 0 * self.dates_as_pandas = 0 # <<<<<<<<<<<<<< @@ -5825,14 +5841,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->dates_as_pandas = 0; - /* "pyreadstat/_readstat_parser.pyx":111 + /* "pyreadstat/_readstat_parser.pyx":112 * self.metaonly = 0 * self.dates_as_pandas = 0 * self.label_to_var_name = dict() # <<<<<<<<<<<<<< * self.labels_raw = dict() * self.notes = list() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->label_to_var_name); @@ -5840,14 +5856,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->label_to_var_name = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":112 + /* "pyreadstat/_readstat_parser.pyx":113 * self.dates_as_pandas = 0 * self.label_to_var_name = dict() * self.labels_raw = dict() # <<<<<<<<<<<<<< * self.notes = list() * self.user_encoding = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->labels_raw); @@ -5855,14 +5871,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":113 + /* "pyreadstat/_readstat_parser.pyx":114 * self.label_to_var_name = dict() * self.labels_raw = dict() * self.notes = list() # <<<<<<<<<<<<<< * self.user_encoding = None * self.table_name = None */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->notes); @@ -5870,7 +5886,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->notes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":114 + /* "pyreadstat/_readstat_parser.pyx":115 * self.labels_raw = dict() * self.notes = list() * self.user_encoding = None # <<<<<<<<<<<<<< @@ -5883,7 +5899,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->user_encoding); __pyx_v_self->user_encoding = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":115 + /* "pyreadstat/_readstat_parser.pyx":116 * self.notes = list() * self.user_encoding = None * self.table_name = None # <<<<<<<<<<<<<< @@ -5896,7 +5912,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->table_name); __pyx_v_self->table_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":116 + /* "pyreadstat/_readstat_parser.pyx":117 * self.user_encoding = None * self.table_name = None * self.filter_cols = 0 # <<<<<<<<<<<<<< @@ -5905,14 +5921,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->filter_cols = 0; - /* "pyreadstat/_readstat_parser.pyx":117 + /* "pyreadstat/_readstat_parser.pyx":118 * self.table_name = None * self.filter_cols = 0 * self.use_cols = list() # <<<<<<<<<<<<<< * self.usernan = 0 * self.missing_ranges = dict() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->use_cols); @@ -5920,7 +5936,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->use_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":118 + /* "pyreadstat/_readstat_parser.pyx":119 * self.filter_cols = 0 * self.use_cols = list() * self.usernan = 0 # <<<<<<<<<<<<<< @@ -5929,14 +5945,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->usernan = 0; - /* "pyreadstat/_readstat_parser.pyx":119 + /* "pyreadstat/_readstat_parser.pyx":120 * self.use_cols = list() * self.usernan = 0 * self.missing_ranges = dict() # <<<<<<<<<<<<<< * self.missing_user_values = dict() * self.variable_storage_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->missing_ranges); @@ -5944,14 +5960,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->missing_ranges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":120 + /* "pyreadstat/_readstat_parser.pyx":121 * self.usernan = 0 * self.missing_ranges = dict() * self.missing_user_values = dict() # <<<<<<<<<<<<<< * self.variable_storage_width = dict() * self.variable_display_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->missing_user_values); @@ -5959,14 +5975,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->missing_user_values = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":121 + /* "pyreadstat/_readstat_parser.pyx":122 * self.missing_ranges = dict() * self.missing_user_values = dict() * self.variable_storage_width = dict() # <<<<<<<<<<<<<< * self.variable_display_width = dict() * self.variable_alignment = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_storage_width); @@ -5974,14 +5990,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_storage_width = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":122 + /* "pyreadstat/_readstat_parser.pyx":123 * self.missing_user_values = dict() * self.variable_storage_width = dict() * self.variable_display_width = dict() # <<<<<<<<<<<<<< * self.variable_alignment = dict() * self.variable_measure = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_display_width); @@ -5989,14 +6005,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_display_width = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":123 + /* "pyreadstat/_readstat_parser.pyx":124 * self.variable_storage_width = dict() * self.variable_display_width = dict() * self.variable_alignment = dict() # <<<<<<<<<<<<<< * self.variable_measure = dict() * self.no_datetime_conversion = 0 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_alignment); @@ -6004,14 +6020,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_alignment = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":124 + /* "pyreadstat/_readstat_parser.pyx":125 * self.variable_display_width = dict() * self.variable_alignment = dict() * self.variable_measure = dict() # <<<<<<<<<<<<<< * self.no_datetime_conversion = 0 * self.ctime = 0 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_measure); @@ -6019,7 +6035,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_measure = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":125 + /* "pyreadstat/_readstat_parser.pyx":126 * self.variable_alignment = dict() * self.variable_measure = dict() * self.no_datetime_conversion = 0 # <<<<<<<<<<<<<< @@ -6028,7 +6044,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->no_datetime_conversion = 0; - /* "pyreadstat/_readstat_parser.pyx":126 + /* "pyreadstat/_readstat_parser.pyx":127 * self.variable_measure = dict() * self.no_datetime_conversion = 0 * self.ctime = 0 # <<<<<<<<<<<<<< @@ -6037,7 +6053,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->ctime = 0; - /* "pyreadstat/_readstat_parser.pyx":127 + /* "pyreadstat/_readstat_parser.pyx":128 * self.no_datetime_conversion = 0 * self.ctime = 0 * self.mtime = 0 # <<<<<<<<<<<<<< @@ -6046,14 +6062,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->mtime = 0; - /* "pyreadstat/_readstat_parser.pyx":128 + /* "pyreadstat/_readstat_parser.pyx":129 * self.ctime = 0 * self.mtime = 0 * self.mr_sets = dict() # <<<<<<<<<<<<<< * self.output_format = "" * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->mr_sets); @@ -6061,7 +6077,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->mr_sets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":129 + /* "pyreadstat/_readstat_parser.pyx":130 * self.mtime = 0 * self.mr_sets = dict() * self.output_format = "" # <<<<<<<<<<<<<< @@ -6298,7 +6314,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_4__se return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":147 +/* "pyreadstat/_readstat_parser.pyx":148 * * * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< @@ -6320,7 +6336,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transform_variable_format", 0); - /* "pyreadstat/_readstat_parser.pyx":151 + /* "pyreadstat/_readstat_parser.pyx":152 * Transforms a readstat var_format to a date, datetime or time format label * """ * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -6330,7 +6346,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":152 + /* "pyreadstat/_readstat_parser.pyx":153 * """ * if file_format == FILE_FORMAT_SAS: * if var_format: # <<<<<<<<<<<<<< @@ -6341,13 +6357,13 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_var_format); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 152, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 0); } if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":153 + /* "pyreadstat/_readstat_parser.pyx":154 * if file_format == FILE_FORMAT_SAS: * if var_format: * format_match = format_regex.match(var_format) # <<<<<<<<<<<<<< @@ -6361,23 +6377,23 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_var_format}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_format_match = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":154 + /* "pyreadstat/_readstat_parser.pyx":155 * if var_format: * format_match = format_regex.match(var_format) * if format_match: # <<<<<<<<<<<<<< * var_format_name = format_match.group(1) * if var_format_name in sas_all_formats: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_format_match); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_format_match); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 155, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":155 + /* "pyreadstat/_readstat_parser.pyx":156 * format_match = format_regex.match(var_format) * if format_match: * var_format_name = format_match.group(1) # <<<<<<<<<<<<<< @@ -6391,33 +6407,33 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_var_format_name = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":156 + /* "pyreadstat/_readstat_parser.pyx":157 * if format_match: * var_format_name = format_match.group(1) * if var_format_name in sas_all_formats: # <<<<<<<<<<<<<< * if var_format_name in sas_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":157 + /* "pyreadstat/_readstat_parser.pyx":158 * var_format_name = format_match.group(1) * if var_format_name in sas_all_formats: * if var_format_name in sas_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format_name in sas_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":158 + /* "pyreadstat/_readstat_parser.pyx":159 * if var_format_name in sas_all_formats: * if var_format_name in sas_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -6427,7 +6443,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":157 + /* "pyreadstat/_readstat_parser.pyx":158 * var_format_name = format_match.group(1) * if var_format_name in sas_all_formats: * if var_format_name in sas_date_formats: # <<<<<<<<<<<<<< @@ -6436,17 +6452,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":159 + /* "pyreadstat/_readstat_parser.pyx":160 * if var_format_name in sas_date_formats: * return DATE_FORMAT_DATE * elif var_format_name in sas_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format_name in sas_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":160 + /* "pyreadstat/_readstat_parser.pyx":161 * return DATE_FORMAT_DATE * elif var_format_name in sas_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -6456,7 +6472,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":159 + /* "pyreadstat/_readstat_parser.pyx":160 * if var_format_name in sas_date_formats: * return DATE_FORMAT_DATE * elif var_format_name in sas_datetime_formats: # <<<<<<<<<<<<<< @@ -6465,17 +6481,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":161 + /* "pyreadstat/_readstat_parser.pyx":162 * elif var_format_name in sas_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format_name in sas_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * return DATE_FORMAT_NOTADATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":162 + /* "pyreadstat/_readstat_parser.pyx":163 * return DATE_FORMAT_DATETIME * elif var_format_name in sas_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -6485,7 +6501,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":161 + /* "pyreadstat/_readstat_parser.pyx":162 * elif var_format_name in sas_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format_name in sas_time_formats: # <<<<<<<<<<<<<< @@ -6494,7 +6510,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":156 + /* "pyreadstat/_readstat_parser.pyx":157 * if format_match: * var_format_name = format_match.group(1) * if var_format_name in sas_all_formats: # <<<<<<<<<<<<<< @@ -6503,7 +6519,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":154 + /* "pyreadstat/_readstat_parser.pyx":155 * if var_format: * format_match = format_regex.match(var_format) * if format_match: # <<<<<<<<<<<<<< @@ -6512,7 +6528,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":152 + /* "pyreadstat/_readstat_parser.pyx":153 * """ * if file_format == FILE_FORMAT_SAS: * if var_format: # <<<<<<<<<<<<<< @@ -6521,7 +6537,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":163 + /* "pyreadstat/_readstat_parser.pyx":164 * elif var_format_name in sas_time_formats: * return DATE_FORMAT_TIME * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -6531,7 +6547,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_NOTADATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":151 + /* "pyreadstat/_readstat_parser.pyx":152 * Transforms a readstat var_format to a date, datetime or time format label * """ * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -6541,7 +6557,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":166 + /* "pyreadstat/_readstat_parser.pyx":167 * * elif file_format == FILE_FORMAT_SPSS: * if var_format: # <<<<<<<<<<<<<< @@ -6552,13 +6568,13 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_var_format); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 166, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 0); } if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":167 + /* "pyreadstat/_readstat_parser.pyx":168 * elif file_format == FILE_FORMAT_SPSS: * if var_format: * format_match = format_regex.match(var_format) # <<<<<<<<<<<<<< @@ -6572,23 +6588,23 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_var_format}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_format_match = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":168 + /* "pyreadstat/_readstat_parser.pyx":169 * if var_format: * format_match = format_regex.match(var_format) * if format_match: # <<<<<<<<<<<<<< * var_format_name = format_match.group(1) * if var_format_name in spss_all_formats: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_format_match); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_format_match); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 169, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":169 + /* "pyreadstat/_readstat_parser.pyx":170 * format_match = format_regex.match(var_format) * if format_match: * var_format_name = format_match.group(1) # <<<<<<<<<<<<<< @@ -6602,33 +6618,33 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_var_format_name = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":170 + /* "pyreadstat/_readstat_parser.pyx":171 * if format_match: * var_format_name = format_match.group(1) * if var_format_name in spss_all_formats: # <<<<<<<<<<<<<< * if var_format_name in spss_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":171 + /* "pyreadstat/_readstat_parser.pyx":172 * var_format_name = format_match.group(1) * if var_format_name in spss_all_formats: * if var_format_name in spss_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format_name in spss_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":172 + /* "pyreadstat/_readstat_parser.pyx":173 * if var_format_name in spss_all_formats: * if var_format_name in spss_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -6638,7 +6654,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":171 + /* "pyreadstat/_readstat_parser.pyx":172 * var_format_name = format_match.group(1) * if var_format_name in spss_all_formats: * if var_format_name in spss_date_formats: # <<<<<<<<<<<<<< @@ -6647,17 +6663,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":173 + /* "pyreadstat/_readstat_parser.pyx":174 * if var_format_name in spss_date_formats: * return DATE_FORMAT_DATE * elif var_format_name in spss_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format_name in spss_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":174 + /* "pyreadstat/_readstat_parser.pyx":175 * return DATE_FORMAT_DATE * elif var_format_name in spss_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -6667,7 +6683,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":173 + /* "pyreadstat/_readstat_parser.pyx":174 * if var_format_name in spss_date_formats: * return DATE_FORMAT_DATE * elif var_format_name in spss_datetime_formats: # <<<<<<<<<<<<<< @@ -6676,17 +6692,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":175 + /* "pyreadstat/_readstat_parser.pyx":176 * elif var_format_name in spss_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format_name in spss_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * return DATE_FORMAT_NOTADATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format_name, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":176 + /* "pyreadstat/_readstat_parser.pyx":177 * return DATE_FORMAT_DATETIME * elif var_format_name in spss_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -6696,7 +6712,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":175 + /* "pyreadstat/_readstat_parser.pyx":176 * elif var_format_name in spss_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format_name in spss_time_formats: # <<<<<<<<<<<<<< @@ -6705,7 +6721,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":170 + /* "pyreadstat/_readstat_parser.pyx":171 * if format_match: * var_format_name = format_match.group(1) * if var_format_name in spss_all_formats: # <<<<<<<<<<<<<< @@ -6714,7 +6730,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":168 + /* "pyreadstat/_readstat_parser.pyx":169 * if var_format: * format_match = format_regex.match(var_format) * if format_match: # <<<<<<<<<<<<<< @@ -6723,7 +6739,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":166 + /* "pyreadstat/_readstat_parser.pyx":167 * * elif file_format == FILE_FORMAT_SPSS: * if var_format: # <<<<<<<<<<<<<< @@ -6732,7 +6748,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":177 + /* "pyreadstat/_readstat_parser.pyx":178 * elif var_format_name in spss_time_formats: * return DATE_FORMAT_TIME * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -6742,7 +6758,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_NOTADATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":165 + /* "pyreadstat/_readstat_parser.pyx":166 * return DATE_FORMAT_NOTADATE * * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -6752,27 +6768,27 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":180 + /* "pyreadstat/_readstat_parser.pyx":181 * * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: # <<<<<<<<<<<<<< * if var_format in stata_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":181 + /* "pyreadstat/_readstat_parser.pyx":182 * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: * if var_format in stata_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":182 + /* "pyreadstat/_readstat_parser.pyx":183 * if var_format in stata_all_formats: * if var_format in stata_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -6782,7 +6798,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":181 + /* "pyreadstat/_readstat_parser.pyx":182 * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: * if var_format in stata_date_formats: # <<<<<<<<<<<<<< @@ -6791,17 +6807,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":183 + /* "pyreadstat/_readstat_parser.pyx":184 * if var_format in stata_date_formats: * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":184 + /* "pyreadstat/_readstat_parser.pyx":185 * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -6811,7 +6827,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":183 + /* "pyreadstat/_readstat_parser.pyx":184 * if var_format in stata_date_formats: * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: # <<<<<<<<<<<<<< @@ -6820,17 +6836,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":185 + /* "pyreadstat/_readstat_parser.pyx":186 * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":186 + /* "pyreadstat/_readstat_parser.pyx":187 * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -6840,7 +6856,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":185 + /* "pyreadstat/_readstat_parser.pyx":186 * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: # <<<<<<<<<<<<<< @@ -6849,7 +6865,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":180 + /* "pyreadstat/_readstat_parser.pyx":181 * * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: # <<<<<<<<<<<<<< @@ -6859,7 +6875,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":188 + /* "pyreadstat/_readstat_parser.pyx":189 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -6872,7 +6888,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L11:; - /* "pyreadstat/_readstat_parser.pyx":179 + /* "pyreadstat/_readstat_parser.pyx":180 * return DATE_FORMAT_NOTADATE * * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -6883,7 +6899,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre default: break; } - /* "pyreadstat/_readstat_parser.pyx":147 + /* "pyreadstat/_readstat_parser.pyx":148 * * * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< @@ -6906,7 +6922,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":190 +/* "pyreadstat/_readstat_parser.pyx":191 * return DATE_FORMAT_NOTADATE * * cdef object transform_datetime(py_datetime_format var_format, double tstamp, py_file_format file_format, object origin, # <<<<<<<<<<<<<< @@ -6934,7 +6950,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transform_datetime", 0); - /* "pyreadstat/_readstat_parser.pyx":208 + /* "pyreadstat/_readstat_parser.pyx":209 * # for any other we return a python datetime, date or time object. * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -6944,17 +6960,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py switch (__pyx_v_var_format) { case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE: - /* "pyreadstat/_readstat_parser.pyx":209 + /* "pyreadstat/_readstat_parser.pyx":210 * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: * if output_format == "polars": # <<<<<<<<<<<<<< * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":211 + /* "pyreadstat/_readstat_parser.pyx":212 * if output_format == "polars": * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -6964,7 +6980,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":213 + /* "pyreadstat/_readstat_parser.pyx":214 * if file_format == FILE_FORMAT_SPSS: * # tstamp is in seconds * return (tstamp - unix_to_origin_secs)/86400 # <<<<<<<<<<<<<< @@ -6972,13 +6988,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * # tstamp is in days */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs) / 86400.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs) / 86400.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":211 + /* "pyreadstat/_readstat_parser.pyx":212 * if output_format == "polars": * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -6987,7 +7003,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":216 + /* "pyreadstat/_readstat_parser.pyx":217 * else: * # tstamp is in days * return tstamp - (unix_to_origin_secs/86400) # <<<<<<<<<<<<<< @@ -6996,14 +7012,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - (__pyx_v_unix_to_origin_secs / 86400.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - (__pyx_v_unix_to_origin_secs / 86400.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":209 + /* "pyreadstat/_readstat_parser.pyx":210 * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: * if output_format == "polars": # <<<<<<<<<<<<<< @@ -7012,7 +7028,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":218 + /* "pyreadstat/_readstat_parser.pyx":219 * return tstamp - (unix_to_origin_secs/86400) * * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7022,7 +7038,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":220 + /* "pyreadstat/_readstat_parser.pyx":221 * if file_format == FILE_FORMAT_SPSS: * # tstamp is in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7031,7 +7047,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":221 + /* "pyreadstat/_readstat_parser.pyx":222 * # tstamp is in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7040,19 +7056,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":222 + /* "pyreadstat/_readstat_parser.pyx":223 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":218 + /* "pyreadstat/_readstat_parser.pyx":219 * return tstamp - (unix_to_origin_secs/86400) * * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7062,7 +7078,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L5; } - /* "pyreadstat/_readstat_parser.pyx":226 + /* "pyreadstat/_readstat_parser.pyx":227 * else: * # tstamp is in days * days = tstamp # <<<<<<<<<<<<<< @@ -7072,33 +7088,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)__pyx_v_tstamp); - /* "pyreadstat/_readstat_parser.pyx":227 + /* "pyreadstat/_readstat_parser.pyx":228 * # tstamp is in days * days = tstamp * tdelta = timedelta_new(days, 0, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L5:; - /* "pyreadstat/_readstat_parser.pyx":229 + /* "pyreadstat/_readstat_parser.pyx":230 * tdelta = timedelta_new(days, 0, 0) * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * if dates_as_pandas: * return mydat */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":230 + /* "pyreadstat/_readstat_parser.pyx":231 * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta * if dates_as_pandas: # <<<<<<<<<<<<<< @@ -7107,7 +7123,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ if (__pyx_v_dates_as_pandas) { - /* "pyreadstat/_readstat_parser.pyx":231 + /* "pyreadstat/_readstat_parser.pyx":232 * mydat = origin + tdelta * if dates_as_pandas: * return mydat # <<<<<<<<<<<<<< @@ -7119,7 +7135,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_r = __pyx_v_mydat; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":230 + /* "pyreadstat/_readstat_parser.pyx":231 * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta * if dates_as_pandas: # <<<<<<<<<<<<<< @@ -7128,7 +7144,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":233 + /* "pyreadstat/_readstat_parser.pyx":234 * return mydat * else: * return mydat.date() # <<<<<<<<<<<<<< @@ -7144,7 +7160,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_date, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; @@ -7152,7 +7168,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":208 + /* "pyreadstat/_readstat_parser.pyx":209 * # for any other we return a python datetime, date or time object. * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -7162,17 +7178,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py break; case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME: - /* "pyreadstat/_readstat_parser.pyx":235 + /* "pyreadstat/_readstat_parser.pyx":236 * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: * if output_format == "polars": # <<<<<<<<<<<<<< * # we want to return timestamp in seconds * if file_format == FILE_FORMAT_STATA: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":237 + /* "pyreadstat/_readstat_parser.pyx":238 * if output_format == "polars": * # we want to return timestamp in seconds * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7182,7 +7198,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":239 + /* "pyreadstat/_readstat_parser.pyx":240 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * return (tstamp/1000) # <<<<<<<<<<<<<< @@ -7190,13 +7206,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * # tstamp in seconds */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp / 1000.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp / 1000.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":237 + /* "pyreadstat/_readstat_parser.pyx":238 * if output_format == "polars": * # we want to return timestamp in seconds * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7205,7 +7221,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":242 + /* "pyreadstat/_readstat_parser.pyx":243 * else: * # tstamp in seconds * return tstamp # <<<<<<<<<<<<<< @@ -7214,14 +7230,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_tstamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_tstamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":235 + /* "pyreadstat/_readstat_parser.pyx":236 * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: * if output_format == "polars": # <<<<<<<<<<<<<< @@ -7230,7 +7246,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":244 + /* "pyreadstat/_readstat_parser.pyx":245 * return tstamp * * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7240,7 +7256,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":246 + /* "pyreadstat/_readstat_parser.pyx":247 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) # <<<<<<<<<<<<<< @@ -7249,7 +7265,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400000.0))); - /* "pyreadstat/_readstat_parser.pyx":247 + /* "pyreadstat/_readstat_parser.pyx":248 * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 # <<<<<<<<<<<<<< @@ -7258,7 +7274,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_msecs = __Pyx_mod_double(__pyx_v_tstamp, 86400000.0, 1); - /* "pyreadstat/_readstat_parser.pyx":248 + /* "pyreadstat/_readstat_parser.pyx":249 * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 * secs = (msecs/1000) # <<<<<<<<<<<<<< @@ -7267,7 +7283,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)(__pyx_v_msecs / 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":249 + /* "pyreadstat/_readstat_parser.pyx":250 * msecs = tstamp % 86400000 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) # <<<<<<<<<<<<<< @@ -7276,19 +7292,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_usecs = ((int)(__Pyx_mod_double(__pyx_v_msecs, 1000.0, 1) * 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":250 + /* "pyreadstat/_readstat_parser.pyx":251 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(milliseconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":244 + /* "pyreadstat/_readstat_parser.pyx":245 * return tstamp * * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7298,7 +7314,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":254 + /* "pyreadstat/_readstat_parser.pyx":255 * else: * # tstamp in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7308,7 +7324,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":255 + /* "pyreadstat/_readstat_parser.pyx":256 * # tstamp in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7317,7 +7333,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":256 + /* "pyreadstat/_readstat_parser.pyx":257 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * usecs = (round(tstamp % 1 * 1e6)) # <<<<<<<<<<<<<< @@ -7325,7 +7341,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * #tdelta = timedelta(seconds=tstamp) */ __pyx_t_3 = NULL; - __pyx_t_5 = PyFloat_FromDouble((__Pyx_mod_double(__pyx_v_tstamp, 1.0, 1) * 1e6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble((__Pyx_mod_double(__pyx_v_tstamp, 1.0, 1) * 1e6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = 1; { @@ -7333,40 +7349,40 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_usecs = ((int)__pyx_t_6); - /* "pyreadstat/_readstat_parser.pyx":257 + /* "pyreadstat/_readstat_parser.pyx":258 * secs = (tstamp % 86400) * usecs = (round(tstamp % 1 * 1e6)) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L9:; - /* "pyreadstat/_readstat_parser.pyx":259 + /* "pyreadstat/_readstat_parser.pyx":260 * tdelta = timedelta_new(days, secs, usecs) * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * return mydat * elif var_format == DATE_FORMAT_TIME: */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":260 + /* "pyreadstat/_readstat_parser.pyx":261 * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta * return mydat # <<<<<<<<<<<<<< @@ -7378,7 +7394,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_r = __pyx_v_mydat; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":234 + /* "pyreadstat/_readstat_parser.pyx":235 * else: * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -7388,7 +7404,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py break; case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME: - /* "pyreadstat/_readstat_parser.pyx":262 + /* "pyreadstat/_readstat_parser.pyx":263 * return mydat * elif var_format == DATE_FORMAT_TIME: * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7398,7 +7414,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":264 + /* "pyreadstat/_readstat_parser.pyx":265 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) # <<<<<<<<<<<<<< @@ -7407,7 +7423,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400000.0))); - /* "pyreadstat/_readstat_parser.pyx":265 + /* "pyreadstat/_readstat_parser.pyx":266 * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 # <<<<<<<<<<<<<< @@ -7416,7 +7432,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_msecs = __Pyx_mod_double(__pyx_v_tstamp, 86400000.0, 1); - /* "pyreadstat/_readstat_parser.pyx":266 + /* "pyreadstat/_readstat_parser.pyx":267 * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 * secs = (msecs/1000) # <<<<<<<<<<<<<< @@ -7425,7 +7441,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)(__pyx_v_msecs / 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":267 + /* "pyreadstat/_readstat_parser.pyx":268 * msecs = tstamp % 86400000 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) # <<<<<<<<<<<<<< @@ -7434,19 +7450,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_usecs = ((int)(__Pyx_mod_double(__pyx_v_msecs, 1000.0, 1) * 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":268 + /* "pyreadstat/_readstat_parser.pyx":269 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(milliseconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":262 + /* "pyreadstat/_readstat_parser.pyx":263 * return mydat * elif var_format == DATE_FORMAT_TIME: * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7456,7 +7472,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":272 + /* "pyreadstat/_readstat_parser.pyx":273 * else: * # tstamp in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7466,7 +7482,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":273 + /* "pyreadstat/_readstat_parser.pyx":274 * # tstamp in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7475,7 +7491,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":274 + /* "pyreadstat/_readstat_parser.pyx":275 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * usecs = (round(tstamp % 1 * 1e6)) # <<<<<<<<<<<<<< @@ -7483,7 +7499,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * #tdelta = timedelta(seconds=tstamp) */ __pyx_t_5 = NULL; - __pyx_t_3 = PyFloat_FromDouble((__Pyx_mod_double(__pyx_v_tstamp, 1.0, 1) * 1e6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((__Pyx_mod_double(__pyx_v_tstamp, 1.0, 1) * 1e6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { @@ -7491,40 +7507,40 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_usecs = ((int)__pyx_t_6); - /* "pyreadstat/_readstat_parser.pyx":275 + /* "pyreadstat/_readstat_parser.pyx":276 * secs = (tstamp % 86400) * usecs = (round(tstamp % 1 * 1e6)) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":277 + /* "pyreadstat/_readstat_parser.pyx":278 * tdelta = timedelta_new(days, secs, usecs) * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * return mydat.time() * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":278 + /* "pyreadstat/_readstat_parser.pyx":279 * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta * return mydat.time() # <<<<<<<<<<<<<< @@ -7539,14 +7555,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_time, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":261 + /* "pyreadstat/_readstat_parser.pyx":262 * mydat = origin + tdelta * return mydat * elif var_format == DATE_FORMAT_TIME: # <<<<<<<<<<<<<< @@ -7557,7 +7573,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py default: break; } - /* "pyreadstat/_readstat_parser.pyx":190 + /* "pyreadstat/_readstat_parser.pyx":191 * return DATE_FORMAT_NOTADATE * * cdef object transform_datetime(py_datetime_format var_format, double tstamp, py_file_format file_format, object origin, # <<<<<<<<<<<<<< @@ -7582,7 +7598,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":281 +/* "pyreadstat/_readstat_parser.pyx":282 * * * cdef object convert_readstat_to_python_value(readstat_value_t value, int index, data_container dc): # <<<<<<<<<<<<<< @@ -7598,7 +7614,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt int __pyx_v_dates_as_pandas; __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; PyObject *__pyx_v_result = 0; - char *__pyx_v_c_str_value; + char const *__pyx_v_c_str_value; PyObject *__pyx_v_py_str_value = 0; int8_t __pyx_v_c_int8_value; int16_t __pyx_v_c_int16_value; @@ -7631,7 +7647,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_readstat_to_python_value", 0); - /* "pyreadstat/_readstat_parser.pyx":309 + /* "pyreadstat/_readstat_parser.pyx":310 * cdef str output_format * * var_type = dc.col_dtypes[index] # <<<<<<<<<<<<<< @@ -7640,15 +7656,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 309, __pyx_L1_error) + __PYX_ERR(0, 310, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_2 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_type = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":310 + /* "pyreadstat/_readstat_parser.pyx":311 * * var_type = dc.col_dtypes[index] * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -7657,15 +7673,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 310, __pyx_L1_error) + __PYX_ERR(0, 311, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_format = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":311 + /* "pyreadstat/_readstat_parser.pyx":312 * var_type = dc.col_dtypes[index] * var_format = dc.col_formats[index] * origin = dc.origin # <<<<<<<<<<<<<< @@ -7677,7 +7693,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_origin = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":312 + /* "pyreadstat/_readstat_parser.pyx":313 * var_format = dc.col_formats[index] * origin = dc.origin * unix_to_origin_secs = dc.unix_to_origin_secs # <<<<<<<<<<<<<< @@ -7687,7 +7703,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_4 = __pyx_v_dc->unix_to_origin_secs; __pyx_v_unix_to_origin_secs = __pyx_t_4; - /* "pyreadstat/_readstat_parser.pyx":313 + /* "pyreadstat/_readstat_parser.pyx":314 * origin = dc.origin * unix_to_origin_secs = dc.unix_to_origin_secs * dates_as_pandas = dc.dates_as_pandas # <<<<<<<<<<<<<< @@ -7697,7 +7713,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_5 = __pyx_v_dc->dates_as_pandas; __pyx_v_dates_as_pandas = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":314 + /* "pyreadstat/_readstat_parser.pyx":315 * unix_to_origin_secs = dc.unix_to_origin_secs * dates_as_pandas = dc.dates_as_pandas * file_format = dc.file_format # <<<<<<<<<<<<<< @@ -7707,7 +7723,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_6 = __pyx_v_dc->file_format; __pyx_v_file_format = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":315 + /* "pyreadstat/_readstat_parser.pyx":316 * dates_as_pandas = dc.dates_as_pandas * file_format = dc.file_format * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -7719,7 +7735,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":318 + /* "pyreadstat/_readstat_parser.pyx":319 * * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -7730,7 +7746,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":319 + /* "pyreadstat/_readstat_parser.pyx":320 * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -7739,7 +7755,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":320 + /* "pyreadstat/_readstat_parser.pyx":321 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * if c_str_value != NULL: # <<<<<<<<<<<<<< @@ -7749,14 +7765,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_5 = (__pyx_v_c_str_value != NULL); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":321 + /* "pyreadstat/_readstat_parser.pyx":322 * c_str_value = readstat_string_value(value) * if c_str_value != NULL: * py_str_value = c_str_value # <<<<<<<<<<<<<< * else: * py_str_value = '' */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -7764,7 +7780,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_py_str_value = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":320 + /* "pyreadstat/_readstat_parser.pyx":321 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * if c_str_value != NULL: # <<<<<<<<<<<<<< @@ -7774,7 +7790,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":323 + /* "pyreadstat/_readstat_parser.pyx":324 * py_str_value = c_str_value * else: * py_str_value = '' # <<<<<<<<<<<<<< @@ -7787,7 +7803,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":324 + /* "pyreadstat/_readstat_parser.pyx":325 * else: * py_str_value = '' * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -7796,7 +7812,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":318 + /* "pyreadstat/_readstat_parser.pyx":319 * * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -7806,7 +7822,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":326 + /* "pyreadstat/_readstat_parser.pyx":327 * pyformat = VAR_FORMAT_STRING * elif var_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -7815,7 +7831,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":327 + /* "pyreadstat/_readstat_parser.pyx":328 * elif var_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -7824,7 +7840,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":328 + /* "pyreadstat/_readstat_parser.pyx":329 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -7833,7 +7849,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":325 + /* "pyreadstat/_readstat_parser.pyx":326 * py_str_value = '' * pyformat = VAR_FORMAT_STRING * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -7843,7 +7859,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":330 + /* "pyreadstat/_readstat_parser.pyx":331 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -7852,7 +7868,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":331 + /* "pyreadstat/_readstat_parser.pyx":332 * elif var_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -7861,7 +7877,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":332 + /* "pyreadstat/_readstat_parser.pyx":333 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -7870,7 +7886,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":329 + /* "pyreadstat/_readstat_parser.pyx":330 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -7880,7 +7896,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":334 + /* "pyreadstat/_readstat_parser.pyx":335 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -7889,7 +7905,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":335 + /* "pyreadstat/_readstat_parser.pyx":336 * elif var_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -7898,7 +7914,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":336 + /* "pyreadstat/_readstat_parser.pyx":337 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -7907,7 +7923,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":333 + /* "pyreadstat/_readstat_parser.pyx":334 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -7917,7 +7933,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":338 + /* "pyreadstat/_readstat_parser.pyx":339 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -7926,7 +7942,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":339 + /* "pyreadstat/_readstat_parser.pyx":340 * elif var_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -7935,7 +7951,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":340 + /* "pyreadstat/_readstat_parser.pyx":341 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -7944,7 +7960,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":337 + /* "pyreadstat/_readstat_parser.pyx":338 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -7954,7 +7970,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":342 + /* "pyreadstat/_readstat_parser.pyx":343 * pyformat = VAR_FORMAT_FLOAT * elif var_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -7963,7 +7979,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":343 + /* "pyreadstat/_readstat_parser.pyx":344 * elif var_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -7972,7 +7988,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":344 + /* "pyreadstat/_readstat_parser.pyx":345 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -7981,7 +7997,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":341 + /* "pyreadstat/_readstat_parser.pyx":342 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -7991,7 +8007,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; default: - /* "pyreadstat/_readstat_parser.pyx":346 + /* "pyreadstat/_readstat_parser.pyx":347 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -7999,7 +8015,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt * # final transformation and storage */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8018,16 +8034,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 346, __pyx_L1_error) + __PYX_ERR(0, 347, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":350 + /* "pyreadstat/_readstat_parser.pyx":351 * # final transformation and storage * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8037,7 +8053,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":351 + /* "pyreadstat/_readstat_parser.pyx":352 * * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8054,18 +8070,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L5_bool_binop_done:; if (likely(__pyx_t_5)) { - /* "pyreadstat/_readstat_parser.pyx":352 + /* "pyreadstat/_readstat_parser.pyx":353 * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_str_value # <<<<<<<<<<<<<< * else: * #str_byte_val = py_str_value.encode("UTF-8") */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 352, __pyx_L1_error) } + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 353, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_py_str_value); __pyx_v_result = __pyx_v_py_str_value; - /* "pyreadstat/_readstat_parser.pyx":351 + /* "pyreadstat/_readstat_parser.pyx":352 * * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8075,7 +8091,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":355 + /* "pyreadstat/_readstat_parser.pyx":356 * else: * #str_byte_val = py_str_value.encode("UTF-8") * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) # <<<<<<<<<<<<<< @@ -8084,18 +8100,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ /*else*/ { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 355, __pyx_L1_error) } - __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_py_str_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 356, __pyx_L1_error) } + __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_py_str_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 355, __pyx_L1_error) + __PYX_ERR(0, 356, __pyx_L1_error) } - __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_12), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_12), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_STRING_type_with_value; @@ -8104,7 +8120,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_14[3] = __pyx_t_13; __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_14, 5, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13)); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -8126,16 +8142,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 355, __pyx_L1_error) + __PYX_ERR(0, 356, __pyx_L1_error) } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":350 + /* "pyreadstat/_readstat_parser.pyx":351 * # final transformation and storage * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8145,7 +8161,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":357 + /* "pyreadstat/_readstat_parser.pyx":358 * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8162,19 +8178,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L8_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":358 + /* "pyreadstat/_readstat_parser.pyx":359 * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_long_value # <<<<<<<<<<<<<< * else: * tstamp = py_long_value */ - __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_py_long_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_py_long_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":357 + /* "pyreadstat/_readstat_parser.pyx":358 * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8184,7 +8200,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L7; } - /* "pyreadstat/_readstat_parser.pyx":360 + /* "pyreadstat/_readstat_parser.pyx":361 * result = py_long_value * else: * tstamp = py_long_value # <<<<<<<<<<<<<< @@ -8194,21 +8210,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt /*else*/ { __pyx_v_tstamp = ((double)__pyx_v_py_long_value); - /* "pyreadstat/_readstat_parser.pyx":361 + /* "pyreadstat/_readstat_parser.pyx":362 * else: * tstamp = py_long_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L7:; - /* "pyreadstat/_readstat_parser.pyx":356 + /* "pyreadstat/_readstat_parser.pyx":357 * #str_byte_val = py_str_value.encode("UTF-8") * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -8218,7 +8234,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":363 + /* "pyreadstat/_readstat_parser.pyx":364 * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8235,19 +8251,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L11_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":364 + /* "pyreadstat/_readstat_parser.pyx":365 * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_float_value # <<<<<<<<<<<<<< * else: * #tstamp = py_float_value */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":363 + /* "pyreadstat/_readstat_parser.pyx":364 * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8257,7 +8273,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":367 + /* "pyreadstat/_readstat_parser.pyx":368 * else: * #tstamp = py_float_value * tstamp = py_float_value # <<<<<<<<<<<<<< @@ -8267,21 +8283,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt /*else*/ { __pyx_v_tstamp = __pyx_v_py_float_value; - /* "pyreadstat/_readstat_parser.pyx":368 + /* "pyreadstat/_readstat_parser.pyx":369 * #tstamp = py_float_value * tstamp = py_float_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) # <<<<<<<<<<<<<< * #elif pyformat == VAR_FORMAT_MISSING: * # pass */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":362 + /* "pyreadstat/_readstat_parser.pyx":363 * tstamp = py_long_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -8291,7 +8307,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; default: - /* "pyreadstat/_readstat_parser.pyx":372 + /* "pyreadstat/_readstat_parser.pyx":373 * # pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< @@ -8299,7 +8315,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt * return result */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8318,16 +8334,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 372, __pyx_L1_error) + __PYX_ERR(0, 373, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":374 + /* "pyreadstat/_readstat_parser.pyx":375 * raise PyreadstatError("Failed convert C to python value") * * return result # <<<<<<<<<<<<<< @@ -8339,7 +8355,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":281 + /* "pyreadstat/_readstat_parser.pyx":282 * * * cdef object convert_readstat_to_python_value(readstat_value_t value, int index, data_container dc): # <<<<<<<<<<<<<< @@ -8367,7 +8383,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":377 +/* "pyreadstat/_readstat_parser.pyx":378 * * * cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8380,14 +8396,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta int __pyx_v_obs_count; int __pyx_v_mr_len; struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_dc = 0; - char *__pyx_v_flabel_orig; - char *__pyx_v_fencoding_orig; + char const *__pyx_v_flabel_orig; + char const *__pyx_v_fencoding_orig; PyObject *__pyx_v_flabel = 0; PyObject *__pyx_v_fencoding = 0; CYTHON_UNUSED int __pyx_v_metaonly; - char *__pyx_v_table; + char const *__pyx_v_table; int __pyx_v_i; - mr_set_t *__pyx_v_mr_sets_orig; + mr_set_t const *__pyx_v_mr_sets_orig; PyObject *__pyx_v_mr_sets = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_variable_list = 0; @@ -8409,52 +8425,52 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":386 + /* "pyreadstat/_readstat_parser.pyx":387 * * cdef int var_count, obs_count, mr_len * cdef data_container dc = ctx # <<<<<<<<<<<<<< * #cdef object row - * cdef char * flabel_orig + * cdef const char * flabel_orig */ __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":395 + /* "pyreadstat/_readstat_parser.pyx":396 * cdef int ctime * cdef int mtime * cdef int i = 0 # <<<<<<<<<<<<<< - * cdef mr_set_t * mr_sets_orig + * cdef const mr_set_t * mr_sets_orig * cdef dict mr_sets = {} */ __pyx_v_i = 0; - /* "pyreadstat/_readstat_parser.pyx":397 + /* "pyreadstat/_readstat_parser.pyx":398 * cdef int i = 0 - * cdef mr_set_t * mr_sets_orig + * cdef const mr_set_t * mr_sets_orig * cdef dict mr_sets = {} # <<<<<<<<<<<<<< * cdef str name * cdef list variable_list = [] */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mr_sets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":399 + /* "pyreadstat/_readstat_parser.pyx":400 * cdef dict mr_sets = {} * cdef str name * cdef list variable_list = [] # <<<<<<<<<<<<<< * * metaonly = dc.metaonly */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":401 + /* "pyreadstat/_readstat_parser.pyx":402 * cdef list variable_list = [] * * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -8464,7 +8480,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":403 + /* "pyreadstat/_readstat_parser.pyx":404 * metaonly = dc.metaonly * * var_count = readstat_get_var_count(metadata) # <<<<<<<<<<<<<< @@ -8473,7 +8489,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_var_count = readstat_get_var_count(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":404 + /* "pyreadstat/_readstat_parser.pyx":405 * * var_count = readstat_get_var_count(metadata) * if var_count<0: # <<<<<<<<<<<<<< @@ -8483,7 +8499,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_var_count < 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":405 + /* "pyreadstat/_readstat_parser.pyx":406 * var_count = readstat_get_var_count(metadata) * if var_count<0: * raise PyreadstatError("Failed to read number of variables") # <<<<<<<<<<<<<< @@ -8491,7 +8507,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta * if obs_count <0: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -8510,14 +8526,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 405, __pyx_L1_error) + __PYX_ERR(0, 406, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":404 + /* "pyreadstat/_readstat_parser.pyx":405 * * var_count = readstat_get_var_count(metadata) * if var_count<0: # <<<<<<<<<<<<<< @@ -8526,7 +8542,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":406 + /* "pyreadstat/_readstat_parser.pyx":407 * if var_count<0: * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) # <<<<<<<<<<<<<< @@ -8535,7 +8551,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_obs_count = readstat_get_row_count(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":407 + /* "pyreadstat/_readstat_parser.pyx":408 * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) * if obs_count <0: # <<<<<<<<<<<<<< @@ -8545,7 +8561,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_obs_count < 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":409 + /* "pyreadstat/_readstat_parser.pyx":410 * if obs_count <0: * # if <0 it means the number of rows is not known, allocate 100 000 * obs_count = 100000 # <<<<<<<<<<<<<< @@ -8554,7 +8570,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_obs_count = 0x186A0; - /* "pyreadstat/_readstat_parser.pyx":410 + /* "pyreadstat/_readstat_parser.pyx":411 * # if <0 it means the number of rows is not known, allocate 100 000 * obs_count = 100000 * dc.is_unkown_number_rows = 1 # <<<<<<<<<<<<<< @@ -8563,7 +8579,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->is_unkown_number_rows = 1; - /* "pyreadstat/_readstat_parser.pyx":407 + /* "pyreadstat/_readstat_parser.pyx":408 * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) * if obs_count <0: # <<<<<<<<<<<<<< @@ -8572,7 +8588,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":412 + /* "pyreadstat/_readstat_parser.pyx":413 * dc.is_unkown_number_rows = 1 * * dc.n_obs = obs_count # <<<<<<<<<<<<<< @@ -8581,7 +8597,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->n_obs = __pyx_v_obs_count; - /* "pyreadstat/_readstat_parser.pyx":413 + /* "pyreadstat/_readstat_parser.pyx":414 * * dc.n_obs = obs_count * dc.n_vars = var_count # <<<<<<<<<<<<<< @@ -8590,7 +8606,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->n_vars = __pyx_v_var_count; - /* "pyreadstat/_readstat_parser.pyx":415 + /* "pyreadstat/_readstat_parser.pyx":416 * dc.n_vars = var_count * * mr_len = readstat_get_multiple_response_sets_length(metadata); # <<<<<<<<<<<<<< @@ -8599,7 +8615,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_mr_len = ((int)readstat_get_multiple_response_sets_length(__pyx_v_metadata)); - /* "pyreadstat/_readstat_parser.pyx":416 + /* "pyreadstat/_readstat_parser.pyx":417 * * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); # <<<<<<<<<<<<<< @@ -8608,7 +8624,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_mr_sets_orig = readstat_get_multiple_response_sets(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":417 + /* "pyreadstat/_readstat_parser.pyx":418 * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: # <<<<<<<<<<<<<< @@ -8618,7 +8634,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_mr_sets_orig != NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":418 + /* "pyreadstat/_readstat_parser.pyx":419 * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: * i = 0 # <<<<<<<<<<<<<< @@ -8627,7 +8643,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_i = 0; - /* "pyreadstat/_readstat_parser.pyx":419 + /* "pyreadstat/_readstat_parser.pyx":420 * if mr_sets_orig != NULL: * i = 0 * while i < mr_len: # <<<<<<<<<<<<<< @@ -8638,14 +8654,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_i < __pyx_v_mr_len); if (!__pyx_t_2) break; - /* "pyreadstat/_readstat_parser.pyx":420 + /* "pyreadstat/_readstat_parser.pyx":421 * i = 0 * while i < mr_len: * name = mr_sets_orig[i].name # <<<<<<<<<<<<<< * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): */ - __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -8653,19 +8669,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_XDECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":421 + /* "pyreadstat/_readstat_parser.pyx":422 * while i < mr_len: * name = mr_sets_orig[i].name * variable_list = [] # <<<<<<<<<<<<<< * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_variable_list, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":422 + /* "pyreadstat/_readstat_parser.pyx":423 * name = mr_sets_orig[i].name * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): # <<<<<<<<<<<<<< @@ -8677,46 +8693,46 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_j = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":423 + /* "pyreadstat/_readstat_parser.pyx":424 * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) # <<<<<<<<<<<<<< * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(((__pyx_v_mr_sets_orig[__pyx_v_i]).subvariables[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(((__pyx_v_mr_sets_orig[__pyx_v_i]).subvariables[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_variable_list, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_variable_list, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "pyreadstat/_readstat_parser.pyx":425 + /* "pyreadstat/_readstat_parser.pyx":426 * variable_list.append(mr_sets_orig[i].subvariables[j]) * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), # <<<<<<<<<<<<<< * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyUnicode_FromOrdinal((__pyx_v_mr_sets_orig[__pyx_v_i]).type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal((__pyx_v_mr_sets_orig[__pyx_v_i]).type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_1) < (0)) __PYX_ERR(0, 425, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_1) < (0)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":426 + /* "pyreadstat/_readstat_parser.pyx":427 * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), # <<<<<<<<<<<<<< * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, */ - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!((__pyx_v_mr_sets_orig[__pyx_v_i]).is_dichotomy != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!((__pyx_v_mr_sets_orig[__pyx_v_i]).is_dichotomy != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_dichotomy, __pyx_t_1) < (0)) __PYX_ERR(0, 425, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_dichotomy, __pyx_t_1) < (0)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":427 + /* "pyreadstat/_readstat_parser.pyx":428 * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, # <<<<<<<<<<<<<< @@ -8725,7 +8741,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_t_2 = ((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value != -1L); if (__pyx_t_2) { - __pyx_t_3 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; @@ -8733,41 +8749,41 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_counted_value, __pyx_t_1) < (0)) __PYX_ERR(0, 425, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_counted_value, __pyx_t_1) < (0)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":428 + /* "pyreadstat/_readstat_parser.pyx":429 * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, # <<<<<<<<<<<<<< * 'variable_list': variable_list * } */ - __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_t_1) < (0)) __PYX_ERR(0, 425, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_t_1) < (0)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":429 + /* "pyreadstat/_readstat_parser.pyx":430 * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, * 'variable_list': variable_list # <<<<<<<<<<<<<< * } * i += 1 */ - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variable_list, __pyx_v_variable_list) < (0)) __PYX_ERR(0, 425, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variable_list, __pyx_v_variable_list) < (0)) __PYX_ERR(0, 426, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":424 + /* "pyreadstat/_readstat_parser.pyx":425 * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) * mr_sets[name] = { # <<<<<<<<<<<<<< * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), */ - if (unlikely((PyDict_SetItem(__pyx_v_mr_sets, __pyx_v_name, __pyx_t_4) < 0))) __PYX_ERR(0, 424, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_mr_sets, __pyx_v_name, __pyx_t_4) < 0))) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":431 + /* "pyreadstat/_readstat_parser.pyx":432 * 'variable_list': variable_list * } * i += 1 # <<<<<<<<<<<<<< @@ -8777,7 +8793,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_i = (__pyx_v_i + 1); } - /* "pyreadstat/_readstat_parser.pyx":432 + /* "pyreadstat/_readstat_parser.pyx":433 * } * i += 1 * dc.mr_sets = mr_sets # <<<<<<<<<<<<<< @@ -8790,7 +8806,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->mr_sets); __pyx_v_dc->mr_sets = __pyx_v_mr_sets; - /* "pyreadstat/_readstat_parser.pyx":417 + /* "pyreadstat/_readstat_parser.pyx":418 * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: # <<<<<<<<<<<<<< @@ -8799,22 +8815,22 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":434 + /* "pyreadstat/_readstat_parser.pyx":435 * dc.mr_sets = mr_sets * * dc.col_data_len = [obs_count] * var_count # <<<<<<<<<<<<<< * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count */ - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_4) != (0)) __PYX_ERR(0, 434, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_4) != (0)) __PYX_ERR(0, 435, __pyx_L1_error); } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8824,20 +8840,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_data_len = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":435 + /* "pyreadstat/_readstat_parser.pyx":436 * * dc.col_data_len = [obs_count] * var_count * dc.col_numpy_dtypes = [None] * var_count # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat = [0] * var_count * dc.col_dtypes_isobject = [0] * var_count */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 435, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 436, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -8846,20 +8862,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_numpy_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":436 + /* "pyreadstat/_readstat_parser.pyx":437 * dc.col_data_len = [obs_count] * var_count * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count # <<<<<<<<<<<<<< * dc.col_dtypes_isobject = [0] * var_count * */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 436, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 437, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -8868,20 +8884,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_dytpes_isfloat = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":437 + /* "pyreadstat/_readstat_parser.pyx":438 * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count * dc.col_dtypes_isobject = [0] * var_count # <<<<<<<<<<<<<< * * # read other metadata */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 437, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 438, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -8890,7 +8906,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_dtypes_isobject = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":440 + /* "pyreadstat/_readstat_parser.pyx":441 * * # read other metadata * flabel_orig = readstat_get_file_label(metadata); # <<<<<<<<<<<<<< @@ -8899,7 +8915,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_flabel_orig = readstat_get_file_label(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":441 + /* "pyreadstat/_readstat_parser.pyx":442 * # read other metadata * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) # <<<<<<<<<<<<<< @@ -8908,7 +8924,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_fencoding_orig = readstat_get_file_encoding(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":442 + /* "pyreadstat/_readstat_parser.pyx":443 * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: # <<<<<<<<<<<<<< @@ -8926,14 +8942,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L11_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":443 + /* "pyreadstat/_readstat_parser.pyx":444 * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: * flabel = flabel_orig # <<<<<<<<<<<<<< * else: * flabel = None */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_flabel_orig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_flabel_orig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -8941,7 +8957,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_flabel = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":442 + /* "pyreadstat/_readstat_parser.pyx":443 * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: # <<<<<<<<<<<<<< @@ -8951,7 +8967,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":445 + /* "pyreadstat/_readstat_parser.pyx":446 * flabel = flabel_orig * else: * flabel = None # <<<<<<<<<<<<<< @@ -8964,7 +8980,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":446 + /* "pyreadstat/_readstat_parser.pyx":447 * else: * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: # <<<<<<<<<<<<<< @@ -8982,14 +8998,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":447 + /* "pyreadstat/_readstat_parser.pyx":448 * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: * fencoding = fencoding_orig # <<<<<<<<<<<<<< * else: * fencoding = None */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_fencoding_orig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_fencoding_orig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); @@ -8997,7 +9013,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_fencoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":446 + /* "pyreadstat/_readstat_parser.pyx":447 * else: * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: # <<<<<<<<<<<<<< @@ -9007,7 +9023,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":449 + /* "pyreadstat/_readstat_parser.pyx":450 * fencoding = fencoding_orig * else: * fencoding = None # <<<<<<<<<<<<<< @@ -9020,7 +9036,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":451 + /* "pyreadstat/_readstat_parser.pyx":452 * fencoding = None * * dc.file_encoding = fencoding # <<<<<<<<<<<<<< @@ -9033,7 +9049,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->file_encoding); __pyx_v_dc->file_encoding = __pyx_v_fencoding; - /* "pyreadstat/_readstat_parser.pyx":452 + /* "pyreadstat/_readstat_parser.pyx":453 * * dc.file_encoding = fencoding * dc.file_label = flabel # <<<<<<<<<<<<<< @@ -9046,7 +9062,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->file_label); __pyx_v_dc->file_label = __pyx_v_flabel; - /* "pyreadstat/_readstat_parser.pyx":454 + /* "pyreadstat/_readstat_parser.pyx":455 * dc.file_label = flabel * * table = readstat_get_table_name(metadata) # <<<<<<<<<<<<<< @@ -9055,7 +9071,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_table = readstat_get_table_name(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":455 + /* "pyreadstat/_readstat_parser.pyx":456 * * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: # <<<<<<<<<<<<<< @@ -9073,14 +9089,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L17_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":456 + /* "pyreadstat/_readstat_parser.pyx":457 * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: * dc.table_name = table # <<<<<<<<<<<<<< * * dc.ctime = readstat_get_creation_time(metadata) */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9091,7 +9107,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->table_name = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":455 + /* "pyreadstat/_readstat_parser.pyx":456 * * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: # <<<<<<<<<<<<<< @@ -9100,7 +9116,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":458 + /* "pyreadstat/_readstat_parser.pyx":459 * dc.table_name = table * * dc.ctime = readstat_get_creation_time(metadata) # <<<<<<<<<<<<<< @@ -9109,7 +9125,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->ctime = readstat_get_creation_time(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":459 + /* "pyreadstat/_readstat_parser.pyx":460 * * dc.ctime = readstat_get_creation_time(metadata) * dc.mtime = readstat_get_modified_time(metadata) # <<<<<<<<<<<<<< @@ -9118,7 +9134,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->mtime = readstat_get_modified_time(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":461 + /* "pyreadstat/_readstat_parser.pyx":462 * dc.mtime = readstat_get_modified_time(metadata) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -9128,7 +9144,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":377 + /* "pyreadstat/_readstat_parser.pyx":378 * * * cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -9154,7 +9170,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":463 +/* "pyreadstat/_readstat_parser.pyx":464 * return READSTAT_HANDLER_OK * * cdef int handle_variable(int index, readstat_variable_t *variable, # <<<<<<<<<<<<<< @@ -9163,13 +9179,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_index, readstat_variable_t *__pyx_v_variable, char *__pyx_v_val_labels, void *__pyx_v_ctx) { - char *__pyx_v_var_name; - char *__pyx_v_var_label; - char *__pyx_v_var_format; + char const *__pyx_v_var_name; + char const *__pyx_v_var_label; + char const *__pyx_v_var_format; + char const *__pyx_v_var_informat; PyObject *__pyx_v_col_name = 0; PyObject *__pyx_v_col_label = 0; PyObject *__pyx_v_label_name = 0; PyObject *__pyx_v_col_format_original = 0; + PyObject *__pyx_v_col_informat_original = 0; PyObject *__pyx_v_output_format = 0; __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_v_col_format_final; readstat_type_t __pyx_v_var_type; @@ -9217,7 +9235,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_variable", 0); - /* "pyreadstat/_readstat_parser.pyx":492 + /* "pyreadstat/_readstat_parser.pyx":494 * cdef int dupcolcnt * * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -9229,7 +9247,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":493 + /* "pyreadstat/_readstat_parser.pyx":495 * * cdef data_container dc = ctx * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -9241,7 +9259,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":496 + /* "pyreadstat/_readstat_parser.pyx":498 * * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) # <<<<<<<<<<<<<< @@ -9250,7 +9268,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_name = readstat_variable_get_name(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":497 + /* "pyreadstat/_readstat_parser.pyx":499 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -9260,7 +9278,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_name == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":498 + /* "pyreadstat/_readstat_parser.pyx":500 * var_name = readstat_variable_get_name(variable) * if var_name == NULL: * col_name = None # <<<<<<<<<<<<<< @@ -9270,7 +9288,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":497 + /* "pyreadstat/_readstat_parser.pyx":499 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -9280,7 +9298,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":500 + /* "pyreadstat/_readstat_parser.pyx":502 * col_name = None * else: * col_name = var_name # <<<<<<<<<<<<<< @@ -9288,7 +9306,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * # if the user introduced a list of columns to include, continue only if the column is in the list */ /*else*/ { - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); @@ -9298,7 +9316,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":503 + /* "pyreadstat/_readstat_parser.pyx":505 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -9310,12 +9328,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->filter_cols; goto __pyx_L5_bool_binop_done; } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":504 + /* "pyreadstat/_readstat_parser.pyx":506 * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 # <<<<<<<<<<<<<< @@ -9324,7 +9342,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dc->n_vars = (__pyx_v_dc->n_vars - 1); - /* "pyreadstat/_readstat_parser.pyx":505 + /* "pyreadstat/_readstat_parser.pyx":507 * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 * return READSTAT_HANDLER_SKIP_VARIABLE # <<<<<<<<<<<<<< @@ -9334,7 +9352,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_SKIP_VARIABLE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":503 + /* "pyreadstat/_readstat_parser.pyx":505 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -9343,7 +9361,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":507 + /* "pyreadstat/_readstat_parser.pyx":509 * return READSTAT_HANDLER_SKIP_VARIABLE * * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -9352,17 +9370,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":509 + /* "pyreadstat/_readstat_parser.pyx":511 * index = readstat_variable_get_index_after_skipping(variable) * * if col_name in dc.col_names: # <<<<<<<<<<<<<< * dupcolcnt = 1 * while True: */ - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":510 + /* "pyreadstat/_readstat_parser.pyx":512 * * if col_name in dc.col_names: * dupcolcnt = 1 # <<<<<<<<<<<<<< @@ -9371,7 +9389,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dupcolcnt = 1; - /* "pyreadstat/_readstat_parser.pyx":511 + /* "pyreadstat/_readstat_parser.pyx":513 * if col_name in dc.col_names: * dupcolcnt = 1 * while True: # <<<<<<<<<<<<<< @@ -9380,28 +9398,28 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ while (1) { - /* "pyreadstat/_readstat_parser.pyx":512 + /* "pyreadstat/_readstat_parser.pyx":514 * dupcolcnt = 1 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) # <<<<<<<<<<<<<< * if newcolname in col_name: * dupcolcnt += 1 */ - __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_col_name, __pyx_mstate_global->__pyx_n_u_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_col_name, __pyx_mstate_global->__pyx_n_u_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_newcolname, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":513 + /* "pyreadstat/_readstat_parser.pyx":515 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: # <<<<<<<<<<<<<< @@ -9410,12 +9428,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_col_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 513, __pyx_L1_error) + __PYX_ERR(0, 515, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 515, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":514 + /* "pyreadstat/_readstat_parser.pyx":516 * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: * dupcolcnt += 1 # <<<<<<<<<<<<<< @@ -9424,7 +9442,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dupcolcnt = (__pyx_v_dupcolcnt + 1); - /* "pyreadstat/_readstat_parser.pyx":515 + /* "pyreadstat/_readstat_parser.pyx":517 * if newcolname in col_name: * dupcolcnt += 1 * continue # <<<<<<<<<<<<<< @@ -9433,7 +9451,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ goto __pyx_L8_continue; - /* "pyreadstat/_readstat_parser.pyx":513 + /* "pyreadstat/_readstat_parser.pyx":515 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: # <<<<<<<<<<<<<< @@ -9442,7 +9460,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":517 + /* "pyreadstat/_readstat_parser.pyx":519 * continue * else: * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) # <<<<<<<<<<<<<< @@ -9457,13 +9475,13 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_col_name, __pyx_v_newcolname}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":518 + /* "pyreadstat/_readstat_parser.pyx":520 * else: * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) * warnings.warn(msg) # <<<<<<<<<<<<<< @@ -9471,9 +9489,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * break */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = 1; @@ -9493,12 +9511,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":519 + /* "pyreadstat/_readstat_parser.pyx":521 * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) * warnings.warn(msg) * col_name = newcolname # <<<<<<<<<<<<<< @@ -9508,7 +9526,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_v_newcolname); __Pyx_DECREF_SET(__pyx_v_col_name, __pyx_v_newcolname); - /* "pyreadstat/_readstat_parser.pyx":520 + /* "pyreadstat/_readstat_parser.pyx":522 * warnings.warn(msg) * col_name = newcolname * break # <<<<<<<<<<<<<< @@ -9521,7 +9539,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L9_break:; - /* "pyreadstat/_readstat_parser.pyx":509 + /* "pyreadstat/_readstat_parser.pyx":511 * index = readstat_variable_get_index_after_skipping(variable) * * if col_name in dc.col_names: # <<<<<<<<<<<<<< @@ -9530,7 +9548,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":522 + /* "pyreadstat/_readstat_parser.pyx":524 * break * * dc.col_names.append(col_name) # <<<<<<<<<<<<<< @@ -9539,11 +9557,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 522, __pyx_L1_error) + __PYX_ERR(0, 524, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 524, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":525 + /* "pyreadstat/_readstat_parser.pyx":527 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -9553,14 +9571,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_val_labels != NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":526 + /* "pyreadstat/_readstat_parser.pyx":528 * # the name of the value label for the variable * if val_labels != NULL: * label_name = val_labels # <<<<<<<<<<<<<< * if label_name: * dc.label_to_var_name[col_name] = label_name */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -9568,7 +9586,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_label_name = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":527 + /* "pyreadstat/_readstat_parser.pyx":529 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -9579,22 +9597,22 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_label_name); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 527, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 529, __pyx_L1_error) __pyx_t_2 = (__pyx_temp != 0); } if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":528 + /* "pyreadstat/_readstat_parser.pyx":530 * label_name = val_labels * if label_name: * dc.label_to_var_name[col_name] = label_name # <<<<<<<<<<<<<< * * var_label = readstat_variable_get_label(variable) */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0))) __PYX_ERR(0, 528, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0))) __PYX_ERR(0, 530, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":527 + /* "pyreadstat/_readstat_parser.pyx":529 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -9603,7 +9621,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":525 + /* "pyreadstat/_readstat_parser.pyx":527 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -9612,7 +9630,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":530 + /* "pyreadstat/_readstat_parser.pyx":532 * dc.label_to_var_name[col_name] = label_name * * var_label = readstat_variable_get_label(variable) # <<<<<<<<<<<<<< @@ -9621,7 +9639,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_label = readstat_variable_get_label(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":531 + /* "pyreadstat/_readstat_parser.pyx":533 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -9631,7 +9649,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_label == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":532 + /* "pyreadstat/_readstat_parser.pyx":534 * var_label = readstat_variable_get_label(variable) * if var_label == NULL: * col_label = None # <<<<<<<<<<<<<< @@ -9641,7 +9659,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":531 + /* "pyreadstat/_readstat_parser.pyx":533 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -9651,7 +9669,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":534 + /* "pyreadstat/_readstat_parser.pyx":536 * col_label = None * else: * col_label = var_label # <<<<<<<<<<<<<< @@ -9659,7 +9677,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); @@ -9669,7 +9687,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":535 + /* "pyreadstat/_readstat_parser.pyx":537 * else: * col_label = var_label * dc.col_labels.append(col_label) # <<<<<<<<<<<<<< @@ -9678,11 +9696,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 535, __pyx_L1_error) + __PYX_ERR(0, 537, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 537, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":538 + /* "pyreadstat/_readstat_parser.pyx":540 * * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) # <<<<<<<<<<<<<< @@ -9691,7 +9709,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_format = readstat_variable_get_format(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":539 + /* "pyreadstat/_readstat_parser.pyx":541 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -9701,7 +9719,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_format == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":541 + /* "pyreadstat/_readstat_parser.pyx":543 * if var_format == NULL: * #col_format_original = "NULL" * col_format_original = None # <<<<<<<<<<<<<< @@ -9711,7 +9729,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_format_original = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":539 + /* "pyreadstat/_readstat_parser.pyx":541 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -9721,15 +9739,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":543 + /* "pyreadstat/_readstat_parser.pyx":545 * col_format_original = None * else: * col_format_original = var_format # <<<<<<<<<<<<<< - * file_format = dc.file_format - * dc.col_formats_original.append(col_format_original) + * # informat (SAS) + * var_informat = readstat_variable_get_informat(variable) */ /*else*/ { - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -9739,41 +9757,111 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":544 - * else: + /* "pyreadstat/_readstat_parser.pyx":547 * col_format_original = var_format + * # informat (SAS) + * var_informat = readstat_variable_get_informat(variable) # <<<<<<<<<<<<<< + * if var_informat == NULL: + * col_informat_original = None +*/ + __pyx_v_var_informat = readstat_variable_get_informat(__pyx_v_variable); + + /* "pyreadstat/_readstat_parser.pyx":548 + * # informat (SAS) + * var_informat = readstat_variable_get_informat(variable) + * if var_informat == NULL: # <<<<<<<<<<<<<< + * col_informat_original = None + * else: +*/ + __pyx_t_2 = (__pyx_v_var_informat == NULL); + if (__pyx_t_2) { + + /* "pyreadstat/_readstat_parser.pyx":549 + * var_informat = readstat_variable_get_informat(variable) + * if var_informat == NULL: + * col_informat_original = None # <<<<<<<<<<<<<< + * else: + * col_informat_original = var_informat +*/ + __Pyx_INCREF(Py_None); + __pyx_v_col_informat_original = ((PyObject*)Py_None); + + /* "pyreadstat/_readstat_parser.pyx":548 + * # informat (SAS) + * var_informat = readstat_variable_get_informat(variable) + * if var_informat == NULL: # <<<<<<<<<<<<<< + * col_informat_original = None + * else: +*/ + goto __pyx_L15; + } + + /* "pyreadstat/_readstat_parser.pyx":551 + * col_informat_original = None + * else: + * col_informat_original = var_informat # <<<<<<<<<<<<<< + * file_format = dc.file_format + * dc.col_formats_original.append(col_format_original) +*/ + /*else*/ { + __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_informat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __pyx_t_7; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_col_informat_original = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L15:; + + /* "pyreadstat/_readstat_parser.pyx":552 + * else: + * col_informat_original = var_informat * file_format = dc.file_format # <<<<<<<<<<<<<< * dc.col_formats_original.append(col_format_original) - * col_format_final = transform_variable_format(col_format_original, file_format) + * dc.col_informats_original.append(col_informat_original) */ __pyx_t_9 = __pyx_v_dc->file_format; __pyx_v_file_format = __pyx_t_9; - /* "pyreadstat/_readstat_parser.pyx":545 - * col_format_original = var_format + /* "pyreadstat/_readstat_parser.pyx":553 + * col_informat_original = var_informat * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) # <<<<<<<<<<<<<< + * dc.col_informats_original.append(col_informat_original) * col_format_final = transform_variable_format(col_format_original, file_format) - * dc.col_formats.append(col_format_final) */ if (unlikely(__pyx_v_dc->col_formats_original == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 545, __pyx_L1_error) + __PYX_ERR(0, 553, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 553, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":546 + /* "pyreadstat/_readstat_parser.pyx":554 * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) + * dc.col_informats_original.append(col_informat_original) # <<<<<<<<<<<<<< + * col_format_final = transform_variable_format(col_format_original, file_format) + * dc.col_formats.append(col_format_final) +*/ + if (unlikely(__pyx_v_dc->col_informats_original == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(0, 554, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_informats_original, __pyx_v_col_informat_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 554, __pyx_L1_error) + + /* "pyreadstat/_readstat_parser.pyx":555 + * dc.col_formats_original.append(col_format_original) + * dc.col_informats_original.append(col_informat_original) * col_format_final = transform_variable_format(col_format_original, file_format) # <<<<<<<<<<<<<< * dc.col_formats.append(col_format_final) * # readstat type */ - __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L1_error) __pyx_v_col_format_final = __pyx_t_10; - /* "pyreadstat/_readstat_parser.pyx":547 - * dc.col_formats_original.append(col_format_original) + /* "pyreadstat/_readstat_parser.pyx":556 + * dc.col_informats_original.append(col_informat_original) * col_format_final = transform_variable_format(col_format_original, file_format) * dc.col_formats.append(col_format_final) # <<<<<<<<<<<<<< * # readstat type @@ -9781,14 +9869,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 547, __pyx_L1_error) + __PYX_ERR(0, 556, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":549 + /* "pyreadstat/_readstat_parser.pyx":558 * dc.col_formats.append(col_format_final) * # readstat type * var_type = readstat_variable_get_type(variable) # <<<<<<<<<<<<<< @@ -9797,7 +9885,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_type = readstat_variable_get_type(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":550 + /* "pyreadstat/_readstat_parser.pyx":559 * # readstat type * var_type = readstat_variable_get_type(variable) * dc.col_dtypes.append(var_type) # <<<<<<<<<<<<<< @@ -9806,14 +9894,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 550, __pyx_L1_error) + __PYX_ERR(0, 559, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 550, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":553 + /* "pyreadstat/_readstat_parser.pyx":562 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< @@ -9824,14 +9912,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; - goto __pyx_L16_bool_binop_done; + goto __pyx_L17_bool_binop_done; } __pyx_t_4 = (__pyx_v_dc->no_datetime_conversion == 0); __pyx_t_2 = __pyx_t_4; - __pyx_L16_bool_binop_done:; + __pyx_L17_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":554 + /* "pyreadstat/_readstat_parser.pyx":563 * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: * curnptype = object # <<<<<<<<<<<<<< @@ -9841,17 +9929,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_builtin_object); __pyx_v_curnptype = __pyx_builtin_object; - /* "pyreadstat/_readstat_parser.pyx":553 + /* "pyreadstat/_readstat_parser.pyx":562 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< * curnptype = object * else: */ - goto __pyx_L15; + goto __pyx_L16; } - /* "pyreadstat/_readstat_parser.pyx":556 + /* "pyreadstat/_readstat_parser.pyx":565 * curnptype = object * else: * curnptype = readstat_to_numpy_types[var_type] # <<<<<<<<<<<<<< @@ -9861,19 +9949,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i /*else*/ { if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 556, __pyx_L1_error) + __PYX_ERR(0, 565, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_curnptype = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_curnptype = __pyx_t_7; + __pyx_t_7 = 0; } - __pyx_L15:; + __pyx_L16:; - /* "pyreadstat/_readstat_parser.pyx":557 + /* "pyreadstat/_readstat_parser.pyx":566 * else: * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 # <<<<<<<<<<<<<< @@ -9882,7 +9970,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 0; - /* "pyreadstat/_readstat_parser.pyx":558 + /* "pyreadstat/_readstat_parser.pyx":567 * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 * iscurnptypeobject = 0 # <<<<<<<<<<<<<< @@ -9891,7 +9979,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 0; - /* "pyreadstat/_readstat_parser.pyx":560 + /* "pyreadstat/_readstat_parser.pyx":569 * iscurnptypeobject = 0 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype # <<<<<<<<<<<<<< @@ -9900,23 +9988,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 560, __pyx_L1_error) + __PYX_ERR(0, 569, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 569, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":561 + /* "pyreadstat/_readstat_parser.pyx":570 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< * iscurnptypeobject = 1 * if curnptype == np.float64: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":562 + /* "pyreadstat/_readstat_parser.pyx":571 * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -9925,7 +10013,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":561 + /* "pyreadstat/_readstat_parser.pyx":570 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< @@ -9934,25 +10022,25 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":563 + /* "pyreadstat/_readstat_parser.pyx":572 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 563, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":564 + /* "pyreadstat/_readstat_parser.pyx":573 * iscurnptypeobject = 1 * if curnptype == np.float64: * iscurnptypefloat = 1 # <<<<<<<<<<<<<< @@ -9961,7 +10049,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 1; - /* "pyreadstat/_readstat_parser.pyx":563 + /* "pyreadstat/_readstat_parser.pyx":572 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< @@ -9970,39 +10058,39 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":565 + /* "pyreadstat/_readstat_parser.pyx":574 * if curnptype == np.float64: * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 565, __pyx_L1_error) + __PYX_ERR(0, 574, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 565, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_7, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":566 + /* "pyreadstat/_readstat_parser.pyx":575 * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat # <<<<<<<<<<<<<< * metaonly = dc.metaonly * # pre-allocate data */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 566, __pyx_L1_error) + __PYX_ERR(0, 575, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_7, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":567 + /* "pyreadstat/_readstat_parser.pyx":576 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -10012,7 +10100,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":569 + /* "pyreadstat/_readstat_parser.pyx":578 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< @@ -10021,67 +10109,67 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (__pyx_v_metaonly) { - /* "pyreadstat/_readstat_parser.pyx":570 + /* "pyreadstat/_readstat_parser.pyx":579 * # pre-allocate data * if metaonly: * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(1, dtype=curnptype) * else: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":571 + /* "pyreadstat/_readstat_parser.pyx":580 * if metaonly: * if output_format == "pandas": * row = np.empty(1, dtype=curnptype) # <<<<<<<<<<<<<< * else: * row = list() */ - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_7); + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_1}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_1}; + __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 571, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_v_row = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_row = __pyx_t_7; + __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":570 + /* "pyreadstat/_readstat_parser.pyx":579 * # pre-allocate data * if metaonly: * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(1, dtype=curnptype) * else: */ - goto __pyx_L21; + goto __pyx_L22; } - /* "pyreadstat/_readstat_parser.pyx":573 + /* "pyreadstat/_readstat_parser.pyx":582 * row = np.empty(1, dtype=curnptype) * else: * row = list() # <<<<<<<<<<<<<< @@ -10089,24 +10177,24 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * obs_count = dc.n_obs */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_row = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_row = __pyx_t_7; + __pyx_t_7 = 0; } - __pyx_L21:; + __pyx_L22:; - /* "pyreadstat/_readstat_parser.pyx":569 + /* "pyreadstat/_readstat_parser.pyx":578 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< * if output_format == "pandas": * row = np.empty(1, dtype=curnptype) */ - goto __pyx_L20; + goto __pyx_L21; } - /* "pyreadstat/_readstat_parser.pyx":575 + /* "pyreadstat/_readstat_parser.pyx":584 * row = list() * else: * obs_count = dc.n_obs # <<<<<<<<<<<<<< @@ -10117,17 +10205,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_11 = __pyx_v_dc->n_obs; __pyx_v_obs_count = __pyx_t_11; - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":585 * else: * obs_count = dc.n_obs * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":577 + /* "pyreadstat/_readstat_parser.pyx":586 * obs_count = dc.n_obs * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) # <<<<<<<<<<<<<< @@ -10135,42 +10223,42 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * row.fill(np.nan) */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5}; - __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_12, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 577, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_12, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_v_row = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_row = __pyx_t_7; + __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":578 + /* "pyreadstat/_readstat_parser.pyx":587 * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -10180,38 +10268,38 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i if (!__pyx_v_iscurnptypeobject) { } else { __pyx_t_2 = __pyx_v_iscurnptypeobject; - goto __pyx_L24_bool_binop_done; + goto __pyx_L25_bool_binop_done; } __pyx_t_2 = __pyx_v_iscurnptypefloat; - __pyx_L24_bool_binop_done:; + __pyx_L25_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":579 + /* "pyreadstat/_readstat_parser.pyx":588 * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * row.fill(np.nan) # <<<<<<<<<<<<<< * else: * row = [None] * obs_count */ - __pyx_t_7 = __pyx_v_row; - __Pyx_INCREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_1 = __pyx_v_row; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_6 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":578 + /* "pyreadstat/_readstat_parser.pyx":587 * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -10220,17 +10308,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":585 * else: * obs_count = dc.n_obs * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: */ - goto __pyx_L22; + goto __pyx_L23; } - /* "pyreadstat/_readstat_parser.pyx":581 + /* "pyreadstat/_readstat_parser.pyx":590 * row.fill(np.nan) * else: * row = [None] * obs_count # <<<<<<<<<<<<<< @@ -10238,23 +10326,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_1 = PyList_New(1 * ((__pyx_v_obs_count<0) ? 0:__pyx_v_obs_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyList_New(1 * ((__pyx_v_obs_count<0) ? 0:__pyx_v_obs_count)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_obs_count; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 581, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 590, __pyx_L1_error); } } - __pyx_v_row = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_row = __pyx_t_7; + __pyx_t_7 = 0; } - __pyx_L22:; + __pyx_L23:; } - __pyx_L20:; + __pyx_L21:; - /* "pyreadstat/_readstat_parser.pyx":582 + /* "pyreadstat/_readstat_parser.pyx":591 * else: * row = [None] * obs_count * dc.col_data.append(row) # <<<<<<<<<<<<<< @@ -10263,11 +10351,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 591, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 591, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":585 + /* "pyreadstat/_readstat_parser.pyx":594 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -10276,7 +10364,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (__pyx_v_dc->usernan) { - /* "pyreadstat/_readstat_parser.pyx":586 + /* "pyreadstat/_readstat_parser.pyx":595 * # missing values * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) # <<<<<<<<<<<<<< @@ -10285,7 +10373,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_n_ranges = readstat_variable_get_missing_ranges_count(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":587 + /* "pyreadstat/_readstat_parser.pyx":596 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -10295,19 +10383,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_n_ranges > 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":588 + /* "pyreadstat/_readstat_parser.pyx":597 * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: * missing_ranges = list() # <<<<<<<<<<<<<< * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_missing_ranges = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_missing_ranges = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":589 + /* "pyreadstat/_readstat_parser.pyx":598 * if n_ranges>0: * missing_ranges = list() * for i in range(0, n_ranges): # <<<<<<<<<<<<<< @@ -10319,7 +10407,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "pyreadstat/_readstat_parser.pyx":590 + /* "pyreadstat/_readstat_parser.pyx":599 * missing_ranges = list() * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) # <<<<<<<<<<<<<< @@ -10328,19 +10416,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_loval = readstat_variable_get_missing_range_lo(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":600 * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) # <<<<<<<<<<<<<< * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_pyloval, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_pyloval, __pyx_t_7); + __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":592 + /* "pyreadstat/_readstat_parser.pyx":601 * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) # <<<<<<<<<<<<<< @@ -10349,34 +10437,34 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_hival = readstat_variable_get_missing_range_hi(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":593 + /* "pyreadstat/_readstat_parser.pyx":602 * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) # <<<<<<<<<<<<<< * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_pyhival, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_pyhival, __pyx_t_7); + __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":594 + /* "pyreadstat/_readstat_parser.pyx":603 * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) # <<<<<<<<<<<<<< * dc.missing_ranges[col_name] = missing_ranges * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lo, __pyx_v_pyloval) < (0)) __PYX_ERR(0, 594, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hi, __pyx_v_pyhival) < (0)) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_lo, __pyx_v_pyloval) < (0)) __PYX_ERR(0, 603, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_hi, __pyx_v_pyhival) < (0)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - /* "pyreadstat/_readstat_parser.pyx":595 + /* "pyreadstat/_readstat_parser.pyx":604 * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges # <<<<<<<<<<<<<< @@ -10385,11 +10473,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->missing_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 595, __pyx_L1_error) + __PYX_ERR(0, 604, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0))) __PYX_ERR(0, 595, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0))) __PYX_ERR(0, 604, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":587 + /* "pyreadstat/_readstat_parser.pyx":596 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -10398,7 +10486,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":585 + /* "pyreadstat/_readstat_parser.pyx":594 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -10407,7 +10495,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":598 + /* "pyreadstat/_readstat_parser.pyx":607 * * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) # <<<<<<<<<<<<<< @@ -10416,35 +10504,35 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_storage_width = readstat_variable_get_storage_width(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":599 + /* "pyreadstat/_readstat_parser.pyx":608 * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) * dc.variable_storage_width[col_name] = storage_width # <<<<<<<<<<<<<< * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) */ - __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyLong_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_dc->variable_storage_width == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 599, __pyx_L1_error) + __PYX_ERR(0, 608, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 599, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely((PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_7) < 0))) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":601 + /* "pyreadstat/_readstat_parser.pyx":610 * dc.variable_storage_width[col_name] = storage_width * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) # <<<<<<<<<<<<<< * * cdef readstat_alignment_t align */ - __pyx_t_1 = __Pyx_PyLong_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyLong_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_7) < 0))) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":605 + /* "pyreadstat/_readstat_parser.pyx":614 * cdef readstat_alignment_t align * cdef str pyalign * align = readstat_variable_get_alignment(variable) # <<<<<<<<<<<<<< @@ -10453,7 +10541,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_align = readstat_variable_get_alignment(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":606 + /* "pyreadstat/_readstat_parser.pyx":615 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -10463,7 +10551,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_align) { case READSTAT_ALIGNMENT_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":607 + /* "pyreadstat/_readstat_parser.pyx":616 * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" # <<<<<<<<<<<<<< @@ -10473,7 +10561,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_unknown; - /* "pyreadstat/_readstat_parser.pyx":606 + /* "pyreadstat/_readstat_parser.pyx":615 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -10483,7 +10571,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_LEFT: - /* "pyreadstat/_readstat_parser.pyx":609 + /* "pyreadstat/_readstat_parser.pyx":618 * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" # <<<<<<<<<<<<<< @@ -10493,7 +10581,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_left); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_left; - /* "pyreadstat/_readstat_parser.pyx":608 + /* "pyreadstat/_readstat_parser.pyx":617 * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: # <<<<<<<<<<<<<< @@ -10503,7 +10591,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_CENTER: - /* "pyreadstat/_readstat_parser.pyx":611 + /* "pyreadstat/_readstat_parser.pyx":620 * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" # <<<<<<<<<<<<<< @@ -10513,7 +10601,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_center); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_center; - /* "pyreadstat/_readstat_parser.pyx":610 + /* "pyreadstat/_readstat_parser.pyx":619 * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: # <<<<<<<<<<<<<< @@ -10523,7 +10611,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_RIGHT: - /* "pyreadstat/_readstat_parser.pyx":613 + /* "pyreadstat/_readstat_parser.pyx":622 * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: * pyalign = "right" # <<<<<<<<<<<<<< @@ -10533,7 +10621,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_right); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_right; - /* "pyreadstat/_readstat_parser.pyx":612 + /* "pyreadstat/_readstat_parser.pyx":621 * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: # <<<<<<<<<<<<<< @@ -10543,7 +10631,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":615 + /* "pyreadstat/_readstat_parser.pyx":624 * pyalign = "right" * else: * pyalign = "undetermined" # <<<<<<<<<<<<<< @@ -10555,16 +10643,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":617 + /* "pyreadstat/_readstat_parser.pyx":626 * pyalign = "undetermined" * * dc.variable_alignment[col_name] = pyalign # <<<<<<<<<<<<<< * * cdef readstat_measure_t measure */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0))) __PYX_ERR(0, 626, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":621 + /* "pyreadstat/_readstat_parser.pyx":630 * cdef readstat_measure_t measure * cdef str pymeasure * measure = readstat_variable_get_measure(variable) # <<<<<<<<<<<<<< @@ -10573,7 +10661,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_measure = readstat_variable_get_measure(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":622 + /* "pyreadstat/_readstat_parser.pyx":631 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -10583,7 +10671,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_measure) { case READSTAT_MEASURE_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":623 + /* "pyreadstat/_readstat_parser.pyx":632 * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" # <<<<<<<<<<<<<< @@ -10593,7 +10681,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_unknown; - /* "pyreadstat/_readstat_parser.pyx":622 + /* "pyreadstat/_readstat_parser.pyx":631 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -10603,7 +10691,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_NOMINAL: - /* "pyreadstat/_readstat_parser.pyx":625 + /* "pyreadstat/_readstat_parser.pyx":634 * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" # <<<<<<<<<<<<<< @@ -10613,7 +10701,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_nominal); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_nominal; - /* "pyreadstat/_readstat_parser.pyx":624 + /* "pyreadstat/_readstat_parser.pyx":633 * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: # <<<<<<<<<<<<<< @@ -10623,7 +10711,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_ORDINAL: - /* "pyreadstat/_readstat_parser.pyx":627 + /* "pyreadstat/_readstat_parser.pyx":636 * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" # <<<<<<<<<<<<<< @@ -10633,7 +10721,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ordinal); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_ordinal; - /* "pyreadstat/_readstat_parser.pyx":626 + /* "pyreadstat/_readstat_parser.pyx":635 * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: # <<<<<<<<<<<<<< @@ -10643,7 +10731,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_SCALE: - /* "pyreadstat/_readstat_parser.pyx":629 + /* "pyreadstat/_readstat_parser.pyx":638 * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: * pymeasure = "scale" # <<<<<<<<<<<<<< @@ -10653,7 +10741,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scale); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_scale; - /* "pyreadstat/_readstat_parser.pyx":628 + /* "pyreadstat/_readstat_parser.pyx":637 * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: # <<<<<<<<<<<<<< @@ -10663,7 +10751,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":631 + /* "pyreadstat/_readstat_parser.pyx":640 * pymeasure = "scale" * else: * pymeasure = "undetermined" # <<<<<<<<<<<<<< @@ -10675,16 +10763,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":633 + /* "pyreadstat/_readstat_parser.pyx":642 * pymeasure = "undetermined" * * dc.variable_measure[col_name] = pymeasure # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0))) __PYX_ERR(0, 633, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0))) __PYX_ERR(0, 642, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":635 + /* "pyreadstat/_readstat_parser.pyx":644 * dc.variable_measure[col_name] = pymeasure * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -10694,7 +10782,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":463 + /* "pyreadstat/_readstat_parser.pyx":464 * return READSTAT_HANDLER_OK * * cdef int handle_variable(int index, readstat_variable_t *variable, # <<<<<<<<<<<<<< @@ -10716,6 +10804,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_XDECREF(__pyx_v_col_label); __Pyx_XDECREF(__pyx_v_label_name); __Pyx_XDECREF(__pyx_v_col_format_original); + __Pyx_XDECREF(__pyx_v_col_informat_original); __Pyx_XDECREF(__pyx_v_output_format); __Pyx_XDECREF(__pyx_v_pyloval); __Pyx_XDECREF(__pyx_v_pyhival); @@ -10731,7 +10820,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":638 +/* "pyreadstat/_readstat_parser.pyx":647 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -10769,7 +10858,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value", 0); - /* "pyreadstat/_readstat_parser.pyx":659 + /* "pyreadstat/_readstat_parser.pyx":668 * * # extract variables we need from data container * dc = ctx # <<<<<<<<<<<<<< @@ -10781,7 +10870,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":660 + /* "pyreadstat/_readstat_parser.pyx":669 * # extract variables we need from data container * dc = ctx * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -10793,7 +10882,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":661 + /* "pyreadstat/_readstat_parser.pyx":670 * dc = ctx * output_format = dc.output_format * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -10802,7 +10891,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":662 + /* "pyreadstat/_readstat_parser.pyx":671 * output_format = dc.output_format * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs # <<<<<<<<<<<<<< @@ -10812,7 +10901,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_2 = __pyx_v_dc->max_n_obs; __pyx_v_max_n_obs = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":663 + /* "pyreadstat/_readstat_parser.pyx":672 * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs * is_unkown_number_rows = dc.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -10822,7 +10911,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = __pyx_v_dc->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":667 + /* "pyreadstat/_readstat_parser.pyx":676 * # check that we still have enough room in our pre-allocated lists * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -10831,15 +10920,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 667, __pyx_L1_error) + __PYX_ERR(0, 676, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":668 + /* "pyreadstat/_readstat_parser.pyx":677 * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] # <<<<<<<<<<<<<< @@ -10848,15 +10937,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 668, __pyx_L1_error) + __PYX_ERR(0, 677, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypefloat = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":669 + /* "pyreadstat/_readstat_parser.pyx":678 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -10865,7 +10954,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (__pyx_v_is_unkown_number_rows) { - /* "pyreadstat/_readstat_parser.pyx":670 + /* "pyreadstat/_readstat_parser.pyx":679 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -10875,7 +10964,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_max_n_obs <= __pyx_v_obs_index); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":671 + /* "pyreadstat/_readstat_parser.pyx":680 * if is_unkown_number_rows: * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 # <<<<<<<<<<<<<< @@ -10884,7 +10973,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_dc->max_n_obs = (__pyx_v_obs_index + 1); - /* "pyreadstat/_readstat_parser.pyx":670 + /* "pyreadstat/_readstat_parser.pyx":679 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -10893,7 +10982,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":672 + /* "pyreadstat/_readstat_parser.pyx":681 * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] # <<<<<<<<<<<<<< @@ -10902,15 +10991,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 672, __pyx_L1_error) + __PYX_ERR(0, 681, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_max_rows = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":673 + /* "pyreadstat/_readstat_parser.pyx":682 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -10920,17 +11009,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_var_max_rows <= __pyx_v_obs_index); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":674 + /* "pyreadstat/_readstat_parser.pyx":683 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * if output_format == "pandas": # <<<<<<<<<<<<<< * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 683, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":675 + /* "pyreadstat/_readstat_parser.pyx":684 * if var_max_rows <= obs_index: * if output_format == "pandas": * curnptype = dc.col_numpy_dtypes[index] # <<<<<<<<<<<<<< @@ -10939,14 +11028,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 675, __pyx_L1_error) + __PYX_ERR(0, 684, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_curnptype = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":676 + /* "pyreadstat/_readstat_parser.pyx":685 * if output_format == "pandas": * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) # <<<<<<<<<<<<<< @@ -10954,9 +11043,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * buf_list.fill(np.nan) */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; @@ -10973,20 +11062,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_100000}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 676, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 685, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_buf_list = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":677 + /* "pyreadstat/_readstat_parser.pyx":686 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -11002,7 +11091,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":678 + /* "pyreadstat/_readstat_parser.pyx":687 * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) # <<<<<<<<<<<<<< @@ -11011,9 +11100,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_t_6 = __pyx_v_buf_list; __Pyx_INCREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 0; @@ -11022,12 +11111,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":677 + /* "pyreadstat/_readstat_parser.pyx":686 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -11036,7 +11125,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":679 + /* "pyreadstat/_readstat_parser.pyx":688 * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) * dc.col_data[index] = np.append(dc.col_data[index], buf_list) # <<<<<<<<<<<<<< @@ -11044,16 +11133,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * buf_list = [None] * 100000 */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 679, __pyx_L1_error) + __PYX_ERR(0, 688, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS @@ -11073,17 +11162,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 679, __pyx_L1_error) + __PYX_ERR(0, 688, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":674 + /* "pyreadstat/_readstat_parser.pyx":683 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11093,7 +11182,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L6; } - /* "pyreadstat/_readstat_parser.pyx":681 + /* "pyreadstat/_readstat_parser.pyx":690 * dc.col_data[index] = np.append(dc.col_data[index], buf_list) * else: * buf_list = [None] * 100000 # <<<<<<<<<<<<<< @@ -11101,19 +11190,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * var_max_rows += 100000 */ /*else*/ { - __pyx_t_1 = PyList_New(1 * 100000); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 100000); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 0x186A0; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 681, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 690, __pyx_L1_error); } } __pyx_v_buf_list = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":682 + /* "pyreadstat/_readstat_parser.pyx":691 * else: * buf_list = [None] * 100000 * dc.col_data[index].extend(buf_list) # <<<<<<<<<<<<<< @@ -11122,9 +11211,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 682, __pyx_L1_error) + __PYX_ERR(0, 691, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); @@ -11134,14 +11223,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L6:; - /* "pyreadstat/_readstat_parser.pyx":683 + /* "pyreadstat/_readstat_parser.pyx":692 * buf_list = [None] * 100000 * dc.col_data[index].extend(buf_list) * var_max_rows += 100000 # <<<<<<<<<<<<<< @@ -11150,23 +11239,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_var_max_rows = (__pyx_v_var_max_rows + 0x186A0); - /* "pyreadstat/_readstat_parser.pyx":684 + /* "pyreadstat/_readstat_parser.pyx":693 * dc.col_data[index].extend(buf_list) * var_max_rows += 100000 * dc.col_data_len[index] = var_max_rows # <<<<<<<<<<<<<< * * # transform to python value types */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 684, __pyx_L1_error) + __PYX_ERR(0, 693, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 684, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":673 + /* "pyreadstat/_readstat_parser.pyx":682 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -11175,7 +11264,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":669 + /* "pyreadstat/_readstat_parser.pyx":678 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -11184,7 +11273,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":687 + /* "pyreadstat/_readstat_parser.pyx":696 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -11194,7 +11283,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":689 + /* "pyreadstat/_readstat_parser.pyx":698 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -11212,17 +11301,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L12_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":690 + /* "pyreadstat/_readstat_parser.pyx":699 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": # <<<<<<<<<<<<<< * if iscurnptypefloat == 1 or iscurnptypeobject == 1: * # already allocated */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 699, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":691 + /* "pyreadstat/_readstat_parser.pyx":700 * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": * if iscurnptypefloat == 1 or iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11242,7 +11331,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L15; } - /* "pyreadstat/_readstat_parser.pyx":697 + /* "pyreadstat/_readstat_parser.pyx":706 * # for any type except float, the numpy type will be object as now we have nans * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -11252,11 +11341,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 706, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 706, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":698 + /* "pyreadstat/_readstat_parser.pyx":707 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -11265,11 +11354,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 698, __pyx_L1_error) + __PYX_ERR(0, 707, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 707, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":699 + /* "pyreadstat/_readstat_parser.pyx":708 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -11278,7 +11367,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":700 + /* "pyreadstat/_readstat_parser.pyx":709 * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -11287,57 +11376,57 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 700, __pyx_L1_error) + __PYX_ERR(0, 709, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_builtin_object}; - __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 700, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 709, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 700, __pyx_L1_error) + __PYX_ERR(0, 709, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 700, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":701 + /* "pyreadstat/_readstat_parser.pyx":710 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index:] = np.nan # <<<<<<<<<<<<<< * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 701, __pyx_L1_error) + __PYX_ERR(0, 710, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < (0)) __PYX_ERR(0, 701, __pyx_L1_error) + if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < (0)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L15:; - /* "pyreadstat/_readstat_parser.pyx":690 + /* "pyreadstat/_readstat_parser.pyx":699 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11346,7 +11435,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":689 + /* "pyreadstat/_readstat_parser.pyx":698 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -11356,7 +11445,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":703 + /* "pyreadstat/_readstat_parser.pyx":712 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -11366,19 +11455,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_defined_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":705 + /* "pyreadstat/_readstat_parser.pyx":714 * elif readstat_value_is_defined_missing(value, variable): * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): */ - __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyvalue = __pyx_t_5; __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":706 + /* "pyreadstat/_readstat_parser.pyx":715 * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -11387,14 +11476,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 706, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely((__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 706, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":703 + /* "pyreadstat/_readstat_parser.pyx":712 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -11404,7 +11493,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":707 + /* "pyreadstat/_readstat_parser.pyx":716 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -11414,7 +11503,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":708 + /* "pyreadstat/_readstat_parser.pyx":717 * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -11423,15 +11512,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 708, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":710 + /* "pyreadstat/_readstat_parser.pyx":719 * iscurnptypeobject = dc.col_dtypes_isobject[index] * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -11440,17 +11529,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":713 + /* "pyreadstat/_readstat_parser.pyx":722 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": # <<<<<<<<<<<<<< * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":714 + /* "pyreadstat/_readstat_parser.pyx":723 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11460,26 +11549,26 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_iscurnptypeobject == 1); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":715 + /* "pyreadstat/_readstat_parser.pyx":724 * if output_format == "pandas": * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_numpy_dtypes[index] = object */ - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 715, __pyx_L1_error) + __PYX_ERR(0, 724, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 715, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":714 + /* "pyreadstat/_readstat_parser.pyx":723 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11489,7 +11578,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L19; } - /* "pyreadstat/_readstat_parser.pyx":717 + /* "pyreadstat/_readstat_parser.pyx":726 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -11499,11 +11588,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 717, __pyx_L1_error) + __PYX_ERR(0, 726, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 717, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 726, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":718 + /* "pyreadstat/_readstat_parser.pyx":727 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -11512,11 +11601,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 718, __pyx_L1_error) + __PYX_ERR(0, 727, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 718, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 727, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":719 + /* "pyreadstat/_readstat_parser.pyx":728 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 # <<<<<<<<<<<<<< @@ -11525,11 +11614,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 719, __pyx_L1_error) + __PYX_ERR(0, 728, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_mstate_global->__pyx_int_0, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_mstate_global->__pyx_int_0, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 728, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":720 + /* "pyreadstat/_readstat_parser.pyx":729 * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -11538,7 +11627,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":721 + /* "pyreadstat/_readstat_parser.pyx":730 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -11547,54 +11636,54 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 730, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_builtin_object}; - __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 721, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 730, __pyx_L1_error) __pyx_t_5 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 730, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference) < 0))) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":722 + /* "pyreadstat/_readstat_parser.pyx":731 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_data[index][obs_index] = chr(missing_tag) */ - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 722, __pyx_L1_error) + __PYX_ERR(0, 731, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L19:; - /* "pyreadstat/_readstat_parser.pyx":713 + /* "pyreadstat/_readstat_parser.pyx":722 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11604,7 +11693,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":724 + /* "pyreadstat/_readstat_parser.pyx":733 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< @@ -11612,21 +11701,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * if curset is None: */ /*else*/ { - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 724, __pyx_L1_error) + __PYX_ERR(0, 733, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":725 + /* "pyreadstat/_readstat_parser.pyx":734 * else: * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) # <<<<<<<<<<<<<< @@ -11635,18 +11724,18 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 725, __pyx_L1_error) + __PYX_ERR(0, 734, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PySet_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_4))) __PYX_ERR(0, 725, __pyx_L1_error) + if (!(likely(PySet_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_4))) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_v_curset = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":726 + /* "pyreadstat/_readstat_parser.pyx":735 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -11656,19 +11745,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_curset == ((PyObject*)Py_None)); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":727 + /* "pyreadstat/_readstat_parser.pyx":736 * curset = dc.missing_user_values.get(index) * if curset is None: * curset = set() # <<<<<<<<<<<<<< * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_curset, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":726 + /* "pyreadstat/_readstat_parser.pyx":735 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -11677,7 +11766,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":728 + /* "pyreadstat/_readstat_parser.pyx":737 * if curset is None: * curset = set() * curset.add(chr(missing_tag)) # <<<<<<<<<<<<<< @@ -11686,14 +11775,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_curset == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); - __PYX_ERR(0, 728, __pyx_L1_error) + __PYX_ERR(0, 737, __pyx_L1_error) } - __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":729 + /* "pyreadstat/_readstat_parser.pyx":738 * curset = set() * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset # <<<<<<<<<<<<<< @@ -11702,14 +11791,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 729, __pyx_L1_error) + __PYX_ERR(0, 738, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_4, __pyx_v_curset) < 0))) __PYX_ERR(0, 729, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_4, __pyx_v_curset) < 0))) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":707 + /* "pyreadstat/_readstat_parser.pyx":716 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -11719,7 +11808,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ } __pyx_L11:; - /* "pyreadstat/_readstat_parser.pyx":687 + /* "pyreadstat/_readstat_parser.pyx":696 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -11729,7 +11818,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":731 + /* "pyreadstat/_readstat_parser.pyx":740 * dc.missing_user_values[index] = curset * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< @@ -11737,12 +11826,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * */ /*else*/ { - __pyx_t_4 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_t_4 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_pyvalue = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":732 + /* "pyreadstat/_readstat_parser.pyx":741 * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -11751,16 +11840,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 732, __pyx_L1_error) + __PYX_ERR(0, 741, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 732, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":734 + /* "pyreadstat/_readstat_parser.pyx":743 * dc.col_data[index][obs_index] = pyvalue * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -11770,7 +11859,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":638 + /* "pyreadstat/_readstat_parser.pyx":647 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -11797,7 +11886,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":737 +/* "pyreadstat/_readstat_parser.pyx":746 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -11807,7 +11896,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__pyx_v_val_labels, readstat_value_t __pyx_v_value, char *__pyx_v_label, void *__pyx_v_ctx) { struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_dc = 0; - char *__pyx_v_c_str_value; + char const *__pyx_v_c_str_value; PyObject *__pyx_v_py_str_value = 0; int8_t __pyx_v_c_int8_value; int16_t __pyx_v_c_int16_value; @@ -11836,26 +11925,26 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value_label", 0); - /* "pyreadstat/_readstat_parser.pyx":743 + /* "pyreadstat/_readstat_parser.pyx":752 * """ * * cdef data_container dc = ctx # <<<<<<<<<<<<<< * - * cdef char * c_str_value + * cdef const char * c_str_value */ __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":761 + /* "pyreadstat/_readstat_parser.pyx":770 * cdef str value_label_name * * var_label = val_labels # <<<<<<<<<<<<<< * value_label_name = label * */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -11863,14 +11952,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_var_label = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":762 + /* "pyreadstat/_readstat_parser.pyx":771 * * var_label = val_labels * value_label_name = label # <<<<<<<<<<<<<< * * cdef readstat_type_t value_type */ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); @@ -11878,7 +11967,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_value_label_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":765 + /* "pyreadstat/_readstat_parser.pyx":774 * * cdef readstat_type_t value_type * value_type = readstat_value_type(value) # <<<<<<<<<<<<<< @@ -11887,7 +11976,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_value_type = readstat_value_type(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":767 + /* "pyreadstat/_readstat_parser.pyx":776 * value_type = readstat_value_type(value) * * labels_raw = dc.labels_raw # <<<<<<<<<<<<<< @@ -11899,7 +11988,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":768 + /* "pyreadstat/_readstat_parser.pyx":777 * * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) # <<<<<<<<<<<<<< @@ -11913,36 +12002,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_var_label}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_cur_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":769 + /* "pyreadstat/_readstat_parser.pyx":778 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< * cur_dict = dict() * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":770 + /* "pyreadstat/_readstat_parser.pyx":779 * cur_dict = labels_raw.get(var_label) * if not cur_dict: * cur_dict = dict() # <<<<<<<<<<<<<< * * if readstat_value_is_tagged_missing(value): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_dict, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":769 + /* "pyreadstat/_readstat_parser.pyx":778 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< @@ -11951,7 +12040,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ } - /* "pyreadstat/_readstat_parser.pyx":772 + /* "pyreadstat/_readstat_parser.pyx":781 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -11961,7 +12050,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_5 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":774 + /* "pyreadstat/_readstat_parser.pyx":783 * if readstat_value_is_tagged_missing(value): * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -11970,19 +12059,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":776 + /* "pyreadstat/_readstat_parser.pyx":785 * missing_tag = readstat_value_tag(value) * # In SAS missing values are A to Z or _ in stata a to z * cur_dict[chr(missing_tag)] = value_label_name # <<<<<<<<<<<<<< * else: * */ - __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 776, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":772 + /* "pyreadstat/_readstat_parser.pyx":781 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -11992,7 +12081,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":779 + /* "pyreadstat/_readstat_parser.pyx":788 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12001,7 +12090,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ /*else*/ { - /* "pyreadstat/_readstat_parser.pyx":799 + /* "pyreadstat/_readstat_parser.pyx":808 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -12011,7 +12100,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_value_type) { case READSTAT_TYPE_STRING: - /* "pyreadstat/_readstat_parser.pyx":779 + /* "pyreadstat/_readstat_parser.pyx":788 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12020,7 +12109,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":780 + /* "pyreadstat/_readstat_parser.pyx":789 * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -12029,14 +12118,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":781 + /* "pyreadstat/_readstat_parser.pyx":790 * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * py_str_value = c_str_value # <<<<<<<<<<<<<< * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12044,7 +12133,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_py_str_value = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":782 + /* "pyreadstat/_readstat_parser.pyx":791 * c_str_value = readstat_string_value(value) * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -12053,7 +12142,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":779 + /* "pyreadstat/_readstat_parser.pyx":788 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12063,7 +12152,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":784 + /* "pyreadstat/_readstat_parser.pyx":793 * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -12072,7 +12161,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":785 + /* "pyreadstat/_readstat_parser.pyx":794 * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -12081,7 +12170,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":786 + /* "pyreadstat/_readstat_parser.pyx":795 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12090,7 +12179,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":783 + /* "pyreadstat/_readstat_parser.pyx":792 * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -12100,7 +12189,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":788 + /* "pyreadstat/_readstat_parser.pyx":797 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -12109,7 +12198,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":789 + /* "pyreadstat/_readstat_parser.pyx":798 * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -12118,7 +12207,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":790 + /* "pyreadstat/_readstat_parser.pyx":799 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12127,7 +12216,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":787 + /* "pyreadstat/_readstat_parser.pyx":796 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -12137,7 +12226,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":792 + /* "pyreadstat/_readstat_parser.pyx":801 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -12146,7 +12235,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":793 + /* "pyreadstat/_readstat_parser.pyx":802 * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -12155,7 +12244,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":794 + /* "pyreadstat/_readstat_parser.pyx":803 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12164,7 +12253,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":791 + /* "pyreadstat/_readstat_parser.pyx":800 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -12174,7 +12263,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":796 + /* "pyreadstat/_readstat_parser.pyx":805 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -12183,7 +12272,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":797 + /* "pyreadstat/_readstat_parser.pyx":806 * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -12192,7 +12281,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":798 + /* "pyreadstat/_readstat_parser.pyx":807 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -12201,7 +12290,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":795 + /* "pyreadstat/_readstat_parser.pyx":804 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -12211,7 +12300,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":800 + /* "pyreadstat/_readstat_parser.pyx":809 * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -12220,7 +12309,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":801 + /* "pyreadstat/_readstat_parser.pyx":810 * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -12229,7 +12318,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":802 + /* "pyreadstat/_readstat_parser.pyx":811 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -12238,7 +12327,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":799 + /* "pyreadstat/_readstat_parser.pyx":808 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -12248,7 +12337,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":804 + /* "pyreadstat/_readstat_parser.pyx":813 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -12256,7 +12345,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -12275,16 +12364,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 804, __pyx_L1_error) + __PYX_ERR(0, 813, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":807 + /* "pyreadstat/_readstat_parser.pyx":816 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -12294,17 +12383,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":808 + /* "pyreadstat/_readstat_parser.pyx":817 * * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 808, __pyx_L1_error) } - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 808, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 817, __pyx_L1_error) } + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 817, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":807 + /* "pyreadstat/_readstat_parser.pyx":816 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -12314,16 +12403,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":810 + /* "pyreadstat/_readstat_parser.pyx":819 * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name */ - if (unlikely((__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 810, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 819, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":809 + /* "pyreadstat/_readstat_parser.pyx":818 * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -12333,19 +12422,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":812 + /* "pyreadstat/_readstat_parser.pyx":821 * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_MISSING: * pass */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 812, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":811 + /* "pyreadstat/_readstat_parser.pyx":820 * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -12355,7 +12444,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_MISSING: - /* "pyreadstat/_readstat_parser.pyx":813 + /* "pyreadstat/_readstat_parser.pyx":822 * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name * elif pyformat == VAR_FORMAT_MISSING: # <<<<<<<<<<<<<< @@ -12365,7 +12454,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":816 + /* "pyreadstat/_readstat_parser.pyx":825 * pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< @@ -12373,7 +12462,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * dc.labels_raw[var_label] = cur_dict */ __pyx_t_6 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -12392,27 +12481,27 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 816, __pyx_L1_error) + __PYX_ERR(0, 825, __pyx_L1_error) break; } } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":818 + /* "pyreadstat/_readstat_parser.pyx":827 * raise PyreadstatError("Failed convert C to python value") * * dc.labels_raw[var_label] = cur_dict # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0))) __PYX_ERR(0, 827, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":820 + /* "pyreadstat/_readstat_parser.pyx":829 * dc.labels_raw[var_label] = cur_dict * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12422,7 +12511,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":737 + /* "pyreadstat/_readstat_parser.pyx":746 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12448,7 +12537,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":822 +/* "pyreadstat/_readstat_parser.pyx":831 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12469,7 +12558,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_note", 0); - /* "pyreadstat/_readstat_parser.pyx":828 + /* "pyreadstat/_readstat_parser.pyx":837 * * cdef str pynote * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -12481,14 +12570,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":830 + /* "pyreadstat/_readstat_parser.pyx":839 * cdef data_container dc = ctx * * pynote = note # <<<<<<<<<<<<<< * dc.notes.append(pynote) * */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12496,16 +12585,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_pynote = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":831 + /* "pyreadstat/_readstat_parser.pyx":840 * * pynote = note * dc.notes.append(pynote) # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 840, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":833 + /* "pyreadstat/_readstat_parser.pyx":842 * dc.notes.append(pynote) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12515,7 +12604,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":822 + /* "pyreadstat/_readstat_parser.pyx":831 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12536,7 +12625,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":835 +/* "pyreadstat/_readstat_parser.pyx":844 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12563,21 +12652,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_open", 0); - /* "pyreadstat/_readstat_parser.pyx":843 + /* "pyreadstat/_readstat_parser.pyx":852 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< * return -1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -12586,15 +12675,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "pyreadstat/_readstat_parser.pyx":844 + /* "pyreadstat/_readstat_parser.pyx":853 * * if not os.path.isfile(u8_path): * return -1 # <<<<<<<<<<<<<< @@ -12604,7 +12693,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = -1; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":843 + /* "pyreadstat/_readstat_parser.pyx":852 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< @@ -12613,36 +12702,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":846 + /* "pyreadstat/_readstat_parser.pyx":855 * return -1 * * if os.name == "nt": # <<<<<<<<<<<<<< * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "pyreadstat/_readstat_parser.pyx":847 + /* "pyreadstat/_readstat_parser.pyx":856 * * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(u8_path, &length) # <<<<<<<<<<<<<< * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyUnicode_AsWideCharString(__pyx_t_4, (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 847, __pyx_L1_error) + __pyx_t_8 = PyUnicode_AsWideCharString(__pyx_t_4, (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_u16_path = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":848 + /* "pyreadstat/_readstat_parser.pyx":857 * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) # <<<<<<<<<<<<<< @@ -12651,7 +12740,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, (_O_RDONLY | _O_BINARY), _SH_DENYWR, 0); - /* "pyreadstat/_readstat_parser.pyx":849 + /* "pyreadstat/_readstat_parser.pyx":858 * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) # <<<<<<<<<<<<<< @@ -12660,7 +12749,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ assign_fd(__pyx_v_io_ctx, __pyx_v_fd); - /* "pyreadstat/_readstat_parser.pyx":850 + /* "pyreadstat/_readstat_parser.pyx":859 * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) * return fd # <<<<<<<<<<<<<< @@ -12670,7 +12759,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":846 + /* "pyreadstat/_readstat_parser.pyx":855 * return -1 * * if os.name == "nt": # <<<<<<<<<<<<<< @@ -12679,7 +12768,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":852 + /* "pyreadstat/_readstat_parser.pyx":861 * return fd * else: * return -1 # <<<<<<<<<<<<<< @@ -12691,7 +12780,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":835 + /* "pyreadstat/_readstat_parser.pyx":844 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12712,8 +12801,8 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":857 - * cdef object _file_object_ctx = None +/* "pyreadstat/_readstat_parser.pyx":865 + * * * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: # <<<<<<<<<<<<<< * """File is already open - this is a no-op""" @@ -12723,7 +12812,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_UNUSED char const *__pyx_v_path, CYTHON_UNUSED void *__pyx_v_io_ctx) { int __pyx_r; - /* "pyreadstat/_readstat_parser.pyx":859 + /* "pyreadstat/_readstat_parser.pyx":867 * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: * """File is already open - this is a no-op""" * return 0 # <<<<<<<<<<<<<< @@ -12733,8 +12822,8 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":857 - * cdef object _file_object_ctx = None + /* "pyreadstat/_readstat_parser.pyx":865 + * * * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: # <<<<<<<<<<<<<< * """File is already open - this is a no-op""" @@ -12746,7 +12835,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":861 +/* "pyreadstat/_readstat_parser.pyx":869 * return 0 * * cdef int pyobject_close_handler(void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -12757,7 +12846,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON_UNUSED void *__pyx_v_io_ctx) { int __pyx_r; - /* "pyreadstat/_readstat_parser.pyx":863 + /* "pyreadstat/_readstat_parser.pyx":871 * cdef int pyobject_close_handler(void *io_ctx) noexcept: * """User manages file lifetime - this is a no-op""" * return 0 # <<<<<<<<<<<<<< @@ -12767,7 +12856,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":861 + /* "pyreadstat/_readstat_parser.pyx":869 * return 0 * * cdef int pyobject_close_handler(void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -12780,19 +12869,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":865 +/* "pyreadstat/_readstat_parser.pyx":873 * return 0 * * cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: # <<<<<<<<<<<<<< * """Bridge Python file.read() to C read operation""" - * global _file_object_ctx + * cdef bytes data */ -static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler(void *__pyx_v_buf, size_t __pyx_v_nbyte, CYTHON_UNUSED void *__pyx_v_io_ctx) { +static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler(void *__pyx_v_buf, size_t __pyx_v_nbyte, void *__pyx_v_io_ctx) { PyObject *__pyx_v_data = 0; Py_ssize_t __pyx_v_bytes_read; char *__pyx_v_data_ptr; - PyObject *__pyx_v_file_obj = NULL; + PyObject *__pyx_v_file_obj = 0; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -12810,58 +12899,60 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pyobject_read_handler", 0); - /* "pyreadstat/_readstat_parser.pyx":872 + /* "pyreadstat/_readstat_parser.pyx":878 + * cdef ssize_t bytes_read * cdef char *data_ptr + * cdef object file_obj = io_ctx # <<<<<<<<<<<<<< + * + * try: +*/ + __pyx_t_1 = ((PyObject *)__pyx_v_io_ctx); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_file_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_parser.pyx":880 + * cdef object file_obj = io_ctx * * try: # <<<<<<<<<<<<<< - * file_obj = _file_object_ctx * data = file_obj.read(nbyte) + * bytes_read = len(data) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":873 + /* "pyreadstat/_readstat_parser.pyx":881 * * try: - * file_obj = _file_object_ctx # <<<<<<<<<<<<<< - * data = file_obj.read(nbyte) - * bytes_read = len(data) -*/ - __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); - __pyx_v_file_obj = __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx; - - /* "pyreadstat/_readstat_parser.pyx":874 - * try: - * file_obj = _file_object_ctx * data = file_obj.read(nbyte) # <<<<<<<<<<<<<< * bytes_read = len(data) * if bytes_read > 0: */ __pyx_t_5 = __pyx_v_file_obj; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_nbyte); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_nbyte); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); } - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 874, __pyx_L3_error) - __pyx_v_data = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 881, __pyx_L3_error) + __pyx_v_data = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":875 - * file_obj = _file_object_ctx + /* "pyreadstat/_readstat_parser.pyx":882 + * try: * data = file_obj.read(nbyte) * bytes_read = len(data) # <<<<<<<<<<<<<< * if bytes_read > 0: @@ -12869,12 +12960,12 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 875, __pyx_L3_error) + __PYX_ERR(0, 882, __pyx_L3_error) } - __pyx_t_8 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 875, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 882, __pyx_L3_error) __pyx_v_bytes_read = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":876 + /* "pyreadstat/_readstat_parser.pyx":883 * data = file_obj.read(nbyte) * bytes_read = len(data) * if bytes_read > 0: # <<<<<<<<<<<<<< @@ -12884,7 +12975,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_t_9 = (__pyx_v_bytes_read > 0); if (__pyx_t_9) { - /* "pyreadstat/_readstat_parser.pyx":877 + /* "pyreadstat/_readstat_parser.pyx":884 * bytes_read = len(data) * if bytes_read > 0: * data_ptr = data # <<<<<<<<<<<<<< @@ -12893,12 +12984,12 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 877, __pyx_L3_error) + __PYX_ERR(0, 884, __pyx_L3_error) } - __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L3_error) + __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error) __pyx_v_data_ptr = ((char *)__pyx_t_10); - /* "pyreadstat/_readstat_parser.pyx":878 + /* "pyreadstat/_readstat_parser.pyx":885 * if bytes_read > 0: * data_ptr = data * memcpy(buf, data_ptr, bytes_read) # <<<<<<<<<<<<<< @@ -12907,7 +12998,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ (void)(memcpy(__pyx_v_buf, __pyx_v_data_ptr, __pyx_v_bytes_read)); - /* "pyreadstat/_readstat_parser.pyx":876 + /* "pyreadstat/_readstat_parser.pyx":883 * data = file_obj.read(nbyte) * bytes_read = len(data) * if bytes_read > 0: # <<<<<<<<<<<<<< @@ -12916,7 +13007,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ } - /* "pyreadstat/_readstat_parser.pyx":879 + /* "pyreadstat/_readstat_parser.pyx":886 * data_ptr = data * memcpy(buf, data_ptr, bytes_read) * return bytes_read # <<<<<<<<<<<<<< @@ -12926,20 +13017,20 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_r = __pyx_v_bytes_read; goto __pyx_L7_try_return; - /* "pyreadstat/_readstat_parser.pyx":872 - * cdef char *data_ptr + /* "pyreadstat/_readstat_parser.pyx":880 + * cdef object file_obj = io_ctx * * try: # <<<<<<<<<<<<<< - * file_obj = _file_object_ctx * data = file_obj.read(nbyte) + * bytes_read = len(data) */ } __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_parser.pyx":880 + /* "pyreadstat/_readstat_parser.pyx":887 * memcpy(buf, data_ptr, bytes_read) * return bytes_read * except: # <<<<<<<<<<<<<< @@ -12949,7 +13040,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( /*except:*/ { __Pyx_ErrRestore(0,0,0); - /* "pyreadstat/_readstat_parser.pyx":881 + /* "pyreadstat/_readstat_parser.pyx":888 * return bytes_read * except: * return -1 # <<<<<<<<<<<<<< @@ -12960,33 +13051,33 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( goto __pyx_L6_except_return; } - /* "pyreadstat/_readstat_parser.pyx":872 - * cdef char *data_ptr + /* "pyreadstat/_readstat_parser.pyx":880 + * cdef object file_obj = io_ctx * * try: # <<<<<<<<<<<<<< - * file_obj = _file_object_ctx * data = file_obj.read(nbyte) + * bytes_read = len(data) */ __pyx_L7_try_return:; - __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L6_except_return:; - __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":865 + /* "pyreadstat/_readstat_parser.pyx":873 * return 0 * * cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: # <<<<<<<<<<<<<< * """Bridge Python file.read() to C read operation""" - * global _file_object_ctx + * cdef bytes data */ /* function exit code */ @@ -12997,17 +13088,17 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":883 +/* "pyreadstat/_readstat_parser.pyx":890 * return -1 * * cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: # <<<<<<<<<<<<<< * """Bridge Python file.seek() to C seek operation""" - * global _file_object_ctx + * cdef int py_whence */ -static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_handler(readstat_off_t __pyx_v_offset, readstat_io_flags_t __pyx_v_whence, CYTHON_UNUSED void *__pyx_v_io_ctx) { +static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_handler(readstat_off_t __pyx_v_offset, readstat_io_flags_t __pyx_v_whence, void *__pyx_v_io_ctx) { int __pyx_v_py_whence; - PyObject *__pyx_v_file_obj = NULL; + PyObject *__pyx_v_file_obj = 0; readstat_off_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -13024,35 +13115,37 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pyobject_seek_handler", 0); - /* "pyreadstat/_readstat_parser.pyx":888 + /* "pyreadstat/_readstat_parser.pyx":893 + * """Bridge Python file.seek() to C seek operation""" * cdef int py_whence + * cdef object file_obj = io_ctx # <<<<<<<<<<<<<< + * + * try: +*/ + __pyx_t_1 = ((PyObject *)__pyx_v_io_ctx); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_file_obj = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_parser.pyx":895 + * cdef object file_obj = io_ctx * * try: # <<<<<<<<<<<<<< - * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: + * py_whence = 0 */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":889 + /* "pyreadstat/_readstat_parser.pyx":896 * * try: - * file_obj = _file_object_ctx # <<<<<<<<<<<<<< - * if whence == READSTAT_SEEK_SET: - * py_whence = 0 -*/ - __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); - __pyx_v_file_obj = __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx; - - /* "pyreadstat/_readstat_parser.pyx":890 - * try: - * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: # <<<<<<<<<<<<<< * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: @@ -13060,8 +13153,8 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand switch (__pyx_v_whence) { case READSTAT_SEEK_SET: - /* "pyreadstat/_readstat_parser.pyx":891 - * file_obj = _file_object_ctx + /* "pyreadstat/_readstat_parser.pyx":897 + * try: * if whence == READSTAT_SEEK_SET: * py_whence = 0 # <<<<<<<<<<<<<< * elif whence == READSTAT_SEEK_CUR: @@ -13069,9 +13162,9 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_v_py_whence = 0; - /* "pyreadstat/_readstat_parser.pyx":890 + /* "pyreadstat/_readstat_parser.pyx":896 + * * try: - * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: # <<<<<<<<<<<<<< * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: @@ -13079,7 +13172,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; case READSTAT_SEEK_CUR: - /* "pyreadstat/_readstat_parser.pyx":893 + /* "pyreadstat/_readstat_parser.pyx":899 * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: * py_whence = 1 # <<<<<<<<<<<<<< @@ -13088,7 +13181,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_v_py_whence = 1; - /* "pyreadstat/_readstat_parser.pyx":892 + /* "pyreadstat/_readstat_parser.pyx":898 * if whence == READSTAT_SEEK_SET: * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: # <<<<<<<<<<<<<< @@ -13098,7 +13191,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; default: - /* "pyreadstat/_readstat_parser.pyx":895 + /* "pyreadstat/_readstat_parser.pyx":901 * py_whence = 1 * else: # READSTAT_SEEK_END * py_whence = 2 # <<<<<<<<<<<<<< @@ -13109,7 +13202,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; } - /* "pyreadstat/_readstat_parser.pyx":897 + /* "pyreadstat/_readstat_parser.pyx":903 * py_whence = 2 * * file_obj.seek(offset, py_whence) # <<<<<<<<<<<<<< @@ -13118,23 +13211,23 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_t_5 = __pyx_v_file_obj; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyLong_From_off_t(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 897, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyLong_From_off_t(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_py_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 897, __pyx_L3_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_py_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_seek, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_seek, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":898 + /* "pyreadstat/_readstat_parser.pyx":904 * * file_obj.seek(offset, py_whence) * return file_obj.tell() # <<<<<<<<<<<<<< @@ -13146,31 +13239,31 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_9 = __Pyx_PyLong_As_off_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((readstat_off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L3_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __Pyx_PyLong_As_off_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((readstat_off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_9; goto __pyx_L7_try_return; - /* "pyreadstat/_readstat_parser.pyx":888 - * cdef int py_whence + /* "pyreadstat/_readstat_parser.pyx":895 + * cdef object file_obj = io_ctx * * try: # <<<<<<<<<<<<<< - * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: + * py_whence = 0 */ } __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":899 + /* "pyreadstat/_readstat_parser.pyx":905 * file_obj.seek(offset, py_whence) * return file_obj.tell() * except: # <<<<<<<<<<<<<< @@ -13180,7 +13273,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand /*except:*/ { __Pyx_ErrRestore(0,0,0); - /* "pyreadstat/_readstat_parser.pyx":900 + /* "pyreadstat/_readstat_parser.pyx":906 * return file_obj.tell() * except: * return -1 # <<<<<<<<<<<<<< @@ -13191,33 +13284,33 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand goto __pyx_L6_except_return; } - /* "pyreadstat/_readstat_parser.pyx":888 - * cdef int py_whence + /* "pyreadstat/_readstat_parser.pyx":895 + * cdef object file_obj = io_ctx * * try: # <<<<<<<<<<<<<< - * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: + * py_whence = 0 */ __pyx_L7_try_return:; - __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; __pyx_L6_except_return:; - __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":883 + /* "pyreadstat/_readstat_parser.pyx":890 * return -1 * * cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: # <<<<<<<<<<<<<< * """Bridge Python file.seek() to C seek operation""" - * global _file_object_ctx + * cdef int py_whence */ /* function exit code */ @@ -13227,7 +13320,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":903 +/* "pyreadstat/_readstat_parser.pyx":909 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -13236,7 +13329,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_error_t __pyx_v_retcode) { - char *__pyx_v_err_readstat; + char const *__pyx_v_err_readstat; PyObject *__pyx_v_err_message = 0; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -13249,8 +13342,8 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_exit_status", 0); - /* "pyreadstat/_readstat_parser.pyx":910 - * cdef char * err_readstat + /* "pyreadstat/_readstat_parser.pyx":916 + * cdef const char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< * err_readstat = readstat_error_message(retcode) @@ -13259,7 +13352,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_1 = (__pyx_v_retcode != READSTAT_OK); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":911 + /* "pyreadstat/_readstat_parser.pyx":917 * cdef str err_message * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< @@ -13268,14 +13361,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - /* "pyreadstat/_readstat_parser.pyx":912 + /* "pyreadstat/_readstat_parser.pyx":918 * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) * err_message = err_readstat # <<<<<<<<<<<<<< * raise ReadstatError(err_message) * */ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); @@ -13283,7 +13376,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_v_err_message = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":913 + /* "pyreadstat/_readstat_parser.pyx":919 * err_readstat = readstat_error_message(retcode) * err_message = err_readstat * raise ReadstatError(err_message) # <<<<<<<<<<<<<< @@ -13291,7 +13384,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e * */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -13310,15 +13403,15 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 913, __pyx_L1_error) + __PYX_ERR(0, 919, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":910 - * cdef char * err_readstat + /* "pyreadstat/_readstat_parser.pyx":916 + * cdef const char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< * err_readstat = readstat_error_message(retcode) @@ -13326,7 +13419,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ } - /* "pyreadstat/_readstat_parser.pyx":903 + /* "pyreadstat/_readstat_parser.pyx":909 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -13346,7 +13439,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":916 +/* "pyreadstat/_readstat_parser.pyx":922 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -13370,6 +13463,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ void *__pyx_v_ctx; PyObject *__pyx_v_pyerr; int __pyx_v_metaonly; + void *__pyx_v_io_ctx; PyObject *__pyx_v_encoding_bytes = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -13386,7 +13480,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } } - /* "pyreadstat/_readstat_parser.pyx":943 + /* "pyreadstat/_readstat_parser.pyx":947 * cdef bytes encoding_byte * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -13396,26 +13490,35 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":944 + /* "pyreadstat/_readstat_parser.pyx":948 * * metaonly = data.metaonly * ctx = data # <<<<<<<<<<<<<< * - * #readstat_error_t error = READSTAT_OK; + * error = READSTAT_OK; */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":947 + /* "pyreadstat/_readstat_parser.pyx":950 + * ctx = data + * + * error = READSTAT_OK; # <<<<<<<<<<<<<< + * parser = readstat_parser_init() + * metadata_handler = handle_metadata +*/ + __pyx_v_error = READSTAT_OK; + + /* "pyreadstat/_readstat_parser.pyx":951 * - * #readstat_error_t error = READSTAT_OK; + * error = READSTAT_OK; * parser = readstat_parser_init() # <<<<<<<<<<<<<< * metadata_handler = handle_metadata * variable_handler = handle_variable */ __pyx_v_parser = readstat_parser_init(); - /* "pyreadstat/_readstat_parser.pyx":948 - * #readstat_error_t error = READSTAT_OK; + /* "pyreadstat/_readstat_parser.pyx":952 + * error = READSTAT_OK; * parser = readstat_parser_init() * metadata_handler = handle_metadata # <<<<<<<<<<<<<< * variable_handler = handle_variable @@ -13423,7 +13526,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_metadata_handler = ((readstat_metadata_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_metadata); - /* "pyreadstat/_readstat_parser.pyx":949 + /* "pyreadstat/_readstat_parser.pyx":953 * parser = readstat_parser_init() * metadata_handler = handle_metadata * variable_handler = handle_variable # <<<<<<<<<<<<<< @@ -13432,7 +13535,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_variable_handler = ((readstat_variable_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_variable); - /* "pyreadstat/_readstat_parser.pyx":950 + /* "pyreadstat/_readstat_parser.pyx":954 * metadata_handler = handle_metadata * variable_handler = handle_variable * value_handler = handle_value # <<<<<<<<<<<<<< @@ -13441,7 +13544,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_handler = ((readstat_value_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value); - /* "pyreadstat/_readstat_parser.pyx":951 + /* "pyreadstat/_readstat_parser.pyx":955 * variable_handler = handle_variable * value_handler = handle_value * value_label_handler = handle_value_label # <<<<<<<<<<<<<< @@ -13450,7 +13553,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_label_handler = ((readstat_value_label_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value_label); - /* "pyreadstat/_readstat_parser.pyx":952 + /* "pyreadstat/_readstat_parser.pyx":956 * value_handler = handle_value * value_label_handler = handle_value_label * note_handler = handle_note # <<<<<<<<<<<<<< @@ -13459,75 +13562,72 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_note_handler = ((readstat_note_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_note); - /* "pyreadstat/_readstat_parser.pyx":955 + /* "pyreadstat/_readstat_parser.pyx":959 * * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":956 + /* "pyreadstat/_readstat_parser.pyx":960 * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":957 + /* "pyreadstat/_readstat_parser.pyx":961 * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_note_handler(parser, note_handler)) * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":958 + /* "pyreadstat/_readstat_parser.pyx":962 * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) # <<<<<<<<<<<<<< * * # Set up custom I/O handlers for file objects */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":961 + /* "pyreadstat/_readstat_parser.pyx":965 * * # Set up custom I/O handlers for file objects * if file_obj is not None: # <<<<<<<<<<<<<< - * _file_object_ctx = file_obj + * io_ctx = file_obj * open_handler = pyobject_open_handler */ __pyx_t_1 = (__pyx_v_file_obj != Py_None); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":962 + /* "pyreadstat/_readstat_parser.pyx":966 * # Set up custom I/O handlers for file objects * if file_obj is not None: - * _file_object_ctx = file_obj # <<<<<<<<<<<<<< + * io_ctx = file_obj # <<<<<<<<<<<<<< * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler */ - __Pyx_INCREF(__pyx_v_file_obj); - __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx, __pyx_v_file_obj); - __Pyx_GIVEREF(__pyx_v_file_obj); + __pyx_v_io_ctx = ((void *)__pyx_v_file_obj); - /* "pyreadstat/_readstat_parser.pyx":963 + /* "pyreadstat/_readstat_parser.pyx":967 * if file_obj is not None: - * _file_object_ctx = file_obj + * io_ctx = file_obj * open_handler = pyobject_open_handler # <<<<<<<<<<<<<< * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler); - /* "pyreadstat/_readstat_parser.pyx":964 - * _file_object_ctx = file_obj + /* "pyreadstat/_readstat_parser.pyx":968 + * io_ctx = file_obj * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler # <<<<<<<<<<<<<< * read_handler = pyobject_read_handler @@ -13535,35 +13635,44 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_close_handler = ((readstat_close_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler); - /* "pyreadstat/_readstat_parser.pyx":965 + /* "pyreadstat/_readstat_parser.pyx":969 * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler # <<<<<<<<<<<<<< * seek_handler = pyobject_seek_handler - * readstat_set_open_handler(parser, open_handler) + * readstat_set_io_ctx(parser, io_ctx) */ __pyx_v_read_handler = ((readstat_read_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler); - /* "pyreadstat/_readstat_parser.pyx":966 + /* "pyreadstat/_readstat_parser.pyx":970 * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler * seek_handler = pyobject_seek_handler # <<<<<<<<<<<<<< + * readstat_set_io_ctx(parser, io_ctx) * readstat_set_open_handler(parser, open_handler) - * readstat_set_close_handler(parser, close_handler) */ __pyx_v_seek_handler = ((readstat_seek_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_handler); - /* "pyreadstat/_readstat_parser.pyx":967 + /* "pyreadstat/_readstat_parser.pyx":971 * read_handler = pyobject_read_handler * seek_handler = pyobject_seek_handler + * readstat_set_io_ctx(parser, io_ctx) # <<<<<<<<<<<<<< + * readstat_set_open_handler(parser, open_handler) + * readstat_set_close_handler(parser, close_handler) +*/ + (void)(readstat_set_io_ctx(__pyx_v_parser, __pyx_v_io_ctx)); + + /* "pyreadstat/_readstat_parser.pyx":972 + * seek_handler = pyobject_seek_handler + * readstat_set_io_ctx(parser, io_ctx) * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":968 - * seek_handler = pyobject_seek_handler + /* "pyreadstat/_readstat_parser.pyx":973 + * readstat_set_io_ctx(parser, io_ctx) * readstat_set_open_handler(parser, open_handler) * readstat_set_close_handler(parser, close_handler) # <<<<<<<<<<<<<< * readstat_set_read_handler(parser, read_handler) @@ -13571,7 +13680,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_close_handler(__pyx_v_parser, __pyx_v_close_handler)); - /* "pyreadstat/_readstat_parser.pyx":969 + /* "pyreadstat/_readstat_parser.pyx":974 * readstat_set_open_handler(parser, open_handler) * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) # <<<<<<<<<<<<<< @@ -13580,7 +13689,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_read_handler(__pyx_v_parser, __pyx_v_read_handler)); - /* "pyreadstat/_readstat_parser.pyx":970 + /* "pyreadstat/_readstat_parser.pyx":975 * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) # <<<<<<<<<<<<<< @@ -13589,33 +13698,33 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_seek_handler(__pyx_v_parser, __pyx_v_seek_handler)); - /* "pyreadstat/_readstat_parser.pyx":961 + /* "pyreadstat/_readstat_parser.pyx":965 * * # Set up custom I/O handlers for file objects * if file_obj is not None: # <<<<<<<<<<<<<< - * _file_object_ctx = file_obj + * io_ctx = file_obj * open_handler = pyobject_open_handler */ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":971 + /* "pyreadstat/_readstat_parser.pyx":976 * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) * elif os.name == "nt": # <<<<<<<<<<<<<< * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":973 + /* "pyreadstat/_readstat_parser.pyx":978 * elif os.name == "nt": * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open # <<<<<<<<<<<<<< @@ -13624,7 +13733,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_open); - /* "pyreadstat/_readstat_parser.pyx":974 + /* "pyreadstat/_readstat_parser.pyx":979 * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< @@ -13633,7 +13742,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":971 + /* "pyreadstat/_readstat_parser.pyx":976 * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) * elif os.name == "nt": # <<<<<<<<<<<<<< @@ -13643,7 +13752,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":976 + /* "pyreadstat/_readstat_parser.pyx":981 * readstat_set_open_handler(parser, open_handler) * * if not metaonly: # <<<<<<<<<<<<<< @@ -13653,16 +13762,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (!__pyx_v_metaonly); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":977 + /* "pyreadstat/_readstat_parser.pyx":982 * * if not metaonly: * check_exit_status(readstat_set_value_handler(parser, value_handler)) # <<<<<<<<<<<<<< * * # if the user set the encoding manually */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":976 + /* "pyreadstat/_readstat_parser.pyx":981 * readstat_set_open_handler(parser, open_handler) * * if not metaonly: # <<<<<<<<<<<<<< @@ -13671,7 +13780,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":980 + /* "pyreadstat/_readstat_parser.pyx":985 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -13682,13 +13791,13 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_data->user_encoding); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 980, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 985, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 0); } if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":981 + /* "pyreadstat/_readstat_parser.pyx":986 * # if the user set the encoding manually * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") # <<<<<<<<<<<<<< @@ -13697,24 +13806,24 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ if (unlikely(__pyx_v_data->user_encoding == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 981, __pyx_L1_error) + __PYX_ERR(0, 986, __pyx_L1_error) } - __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_data->user_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_data->user_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_encoding_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":982 + /* "pyreadstat/_readstat_parser.pyx":987 * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") * readstat_set_file_character_encoding(parser, encoding_bytes) # <<<<<<<<<<<<<< * * if row_limit: */ - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L1_error) (void)(readstat_set_file_character_encoding(__pyx_v_parser, ((char *)__pyx_t_4))); - /* "pyreadstat/_readstat_parser.pyx":980 + /* "pyreadstat/_readstat_parser.pyx":985 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -13723,7 +13832,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":984 + /* "pyreadstat/_readstat_parser.pyx":989 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -13733,16 +13842,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_limit != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":985 + /* "pyreadstat/_readstat_parser.pyx":990 * * if row_limit: * check_exit_status(readstat_set_row_limit(parser, row_limit)) # <<<<<<<<<<<<<< * * if row_offset: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 990, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":984 + /* "pyreadstat/_readstat_parser.pyx":989 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -13751,7 +13860,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":987 + /* "pyreadstat/_readstat_parser.pyx":992 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -13761,16 +13870,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_offset != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":988 + /* "pyreadstat/_readstat_parser.pyx":993 * * if row_offset: * check_exit_status(readstat_set_row_offset(parser, row_offset)) # <<<<<<<<<<<<<< * * # parse! */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 993, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":987 + /* "pyreadstat/_readstat_parser.pyx":992 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -13779,7 +13888,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":991 + /* "pyreadstat/_readstat_parser.pyx":996 * * # parse! * if file_extension == FILE_EXT_SAV: # <<<<<<<<<<<<<< @@ -13789,7 +13898,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ switch (__pyx_v_file_extension) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV: - /* "pyreadstat/_readstat_parser.pyx":992 + /* "pyreadstat/_readstat_parser.pyx":997 * # parse! * if file_extension == FILE_EXT_SAV: * error = readstat_parse_sav(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -13798,7 +13907,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sav(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":991 + /* "pyreadstat/_readstat_parser.pyx":996 * * # parse! * if file_extension == FILE_EXT_SAV: # <<<<<<<<<<<<<< @@ -13808,7 +13917,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT: - /* "pyreadstat/_readstat_parser.pyx":994 + /* "pyreadstat/_readstat_parser.pyx":999 * error = readstat_parse_sav(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BDAT: * error = readstat_parse_sas7bdat(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -13817,7 +13926,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sas7bdat(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":993 + /* "pyreadstat/_readstat_parser.pyx":998 * if file_extension == FILE_EXT_SAV: * error = readstat_parse_sav(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -13827,7 +13936,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA: - /* "pyreadstat/_readstat_parser.pyx":996 + /* "pyreadstat/_readstat_parser.pyx":1001 * error = readstat_parse_sas7bdat(parser, filename, ctx); * elif file_extension == FILE_EXT_DTA: * error = readstat_parse_dta(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -13836,7 +13945,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_dta(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":995 + /* "pyreadstat/_readstat_parser.pyx":1000 * elif file_extension == FILE_EXT_SAS7BDAT: * error = readstat_parse_sas7bdat(parser, filename, ctx); * elif file_extension == FILE_EXT_DTA: # <<<<<<<<<<<<<< @@ -13846,7 +13955,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT: - /* "pyreadstat/_readstat_parser.pyx":998 + /* "pyreadstat/_readstat_parser.pyx":1003 * error = readstat_parse_dta(parser, filename, ctx); * elif file_extension == FILE_EXT_XPORT: * error = readstat_parse_xport(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -13855,7 +13964,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_xport(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":997 + /* "pyreadstat/_readstat_parser.pyx":1002 * elif file_extension == FILE_EXT_DTA: * error = readstat_parse_dta(parser, filename, ctx); * elif file_extension == FILE_EXT_XPORT: # <<<<<<<<<<<<<< @@ -13865,7 +13974,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR: - /* "pyreadstat/_readstat_parser.pyx":1000 + /* "pyreadstat/_readstat_parser.pyx":1005 * error = readstat_parse_xport(parser, filename, ctx); * elif file_extension == FILE_EXT_POR: * error = readstat_parse_por(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -13874,7 +13983,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_por(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":999 + /* "pyreadstat/_readstat_parser.pyx":1004 * elif file_extension == FILE_EXT_XPORT: * error = readstat_parse_xport(parser, filename, ctx); * elif file_extension == FILE_EXT_POR: # <<<<<<<<<<<<<< @@ -13884,7 +13993,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT: - /* "pyreadstat/_readstat_parser.pyx":1002 + /* "pyreadstat/_readstat_parser.pyx":1007 * error = readstat_parse_por(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BCAT: * error = readstat_parse_sas7bcat(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -13893,7 +14002,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sas7bcat(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1001 + /* "pyreadstat/_readstat_parser.pyx":1006 * elif file_extension == FILE_EXT_POR: * error = readstat_parse_por(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -13904,7 +14013,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ default: break; } - /* "pyreadstat/_readstat_parser.pyx":1004 + /* "pyreadstat/_readstat_parser.pyx":1009 * error = readstat_parse_sas7bcat(parser, filename, ctx); * #error = parse_func(parser, filename, ctx); * readstat_parser_free(parser) # <<<<<<<<<<<<<< @@ -13913,7 +14022,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ readstat_parser_free(__pyx_v_parser); - /* "pyreadstat/_readstat_parser.pyx":1007 + /* "pyreadstat/_readstat_parser.pyx":1012 * # check if a python error ocurred, if yes, it will be printed by the interpreter, * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() # <<<<<<<<<<<<<< @@ -13922,7 +14031,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_pyerr = PyErr_Occurred(); - /* "pyreadstat/_readstat_parser.pyx":1008 + /* "pyreadstat/_readstat_parser.pyx":1013 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -13932,16 +14041,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (((void *)__pyx_v_pyerr) == NULL); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1009 + /* "pyreadstat/_readstat_parser.pyx":1014 * pyerr = PyErr_Occurred() * if pyerr == NULL: * check_exit_status(error) # <<<<<<<<<<<<<< * * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1008 + /* "pyreadstat/_readstat_parser.pyx":1013 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -13950,7 +14059,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":916 + /* "pyreadstat/_readstat_parser.pyx":922 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -13969,7 +14078,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":1012 +/* "pyreadstat/_readstat_parser.pyx":1017 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -14003,7 +14112,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_to_dict", 0); - /* "pyreadstat/_readstat_parser.pyx":1026 + /* "pyreadstat/_readstat_parser.pyx":1031 * cdef bint metaonly * * final_container = OrderedDict() # <<<<<<<<<<<<<< @@ -14011,7 +14120,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * col_names = data.col_names */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1026, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -14030,13 +14139,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_final_container = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1027 + /* "pyreadstat/_readstat_parser.pyx":1032 * * final_container = OrderedDict() * col_data = data.col_data # <<<<<<<<<<<<<< @@ -14048,7 +14157,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1028 + /* "pyreadstat/_readstat_parser.pyx":1033 * final_container = OrderedDict() * col_data = data.col_data * col_names = data.col_names # <<<<<<<<<<<<<< @@ -14060,7 +14169,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1029 + /* "pyreadstat/_readstat_parser.pyx":1034 * col_data = data.col_data * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -14070,7 +14179,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":1030 + /* "pyreadstat/_readstat_parser.pyx":1035 * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs # <<<<<<<<<<<<<< @@ -14080,7 +14189,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_6 = __pyx_v_data->max_n_obs; __pyx_v_max_n_obs = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1031 + /* "pyreadstat/_readstat_parser.pyx":1036 * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -14090,7 +14199,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":1033 + /* "pyreadstat/_readstat_parser.pyx":1038 * metaonly = data.metaonly * * for fc_cnt in range(0, len(col_names)): # <<<<<<<<<<<<<< @@ -14099,14 +14208,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1033, __pyx_L1_error) + __PYX_ERR(0, 1038, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1038, __pyx_L1_error) __pyx_t_8 = __pyx_t_7; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) { __pyx_v_fc_cnt = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1034 + /* "pyreadstat/_readstat_parser.pyx":1039 * * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] # <<<<<<<<<<<<<< @@ -14115,15 +14224,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1034, __pyx_L1_error) + __PYX_ERR(0, 1039, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1034, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cur_name_str, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1035 + /* "pyreadstat/_readstat_parser.pyx":1040 * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] # <<<<<<<<<<<<<< @@ -14132,14 +14241,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1035, __pyx_L1_error) + __PYX_ERR(0, 1040, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1036 + /* "pyreadstat/_readstat_parser.pyx":1041 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -14156,19 +14265,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":1037 + /* "pyreadstat/_readstat_parser.pyx":1042 * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] # <<<<<<<<<<<<<< * if not metaonly: * final_container[cur_name_str] = cur_data */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1036 + /* "pyreadstat/_readstat_parser.pyx":1041 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -14177,7 +14286,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ } - /* "pyreadstat/_readstat_parser.pyx":1038 + /* "pyreadstat/_readstat_parser.pyx":1043 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -14187,16 +14296,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = (!__pyx_v_metaonly); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":1039 + /* "pyreadstat/_readstat_parser.pyx":1044 * cur_data = cur_data[0:max_n_obs] * if not metaonly: * final_container[cur_name_str] = cur_data # <<<<<<<<<<<<<< * else: * final_container[cur_name_str] = list() */ - if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0))) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0))) __PYX_ERR(0, 1044, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1038 + /* "pyreadstat/_readstat_parser.pyx":1043 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -14206,7 +14315,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( goto __pyx_L8; } - /* "pyreadstat/_readstat_parser.pyx":1041 + /* "pyreadstat/_readstat_parser.pyx":1046 * final_container[cur_name_str] = cur_data * else: * final_container[cur_name_str] = list() # <<<<<<<<<<<<<< @@ -14214,15 +14323,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * return final_container */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0))) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; } - /* "pyreadstat/_readstat_parser.pyx":1043 + /* "pyreadstat/_readstat_parser.pyx":1048 * final_container[cur_name_str] = list() * * return final_container # <<<<<<<<<<<<<< @@ -14234,7 +14343,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_r = __pyx_v_final_container; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1012 + /* "pyreadstat/_readstat_parser.pyx":1017 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -14260,7 +14369,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1045 +/* "pyreadstat/_readstat_parser.pyx":1050 * return final_container * * cdef object dict_to_dataframe(object dict_data, data_container dc): # <<<<<<<<<<<<<< @@ -14319,7 +14428,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict_to_dataframe", 0); - /* "pyreadstat/_readstat_parser.pyx":1055 + /* "pyreadstat/_readstat_parser.pyx":1060 * cdef py_datetime_format var_format * cdef list dtypes, sertypes, datetime_cols, date_cols * cdef dict schema = None # <<<<<<<<<<<<<< @@ -14329,7 +14438,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(Py_None); __pyx_v_schema = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":1057 + /* "pyreadstat/_readstat_parser.pyx":1062 * cdef dict schema = None * * dates_as_pandas = dc.dates_as_pandas # <<<<<<<<<<<<<< @@ -14339,7 +14448,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_1 = __pyx_v_dc->dates_as_pandas; __pyx_v_dates_as_pandas = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1058 + /* "pyreadstat/_readstat_parser.pyx":1063 * * dates_as_pandas = dc.dates_as_pandas * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -14351,47 +14460,47 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_v_output_format = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1060 + /* "pyreadstat/_readstat_parser.pyx":1065 * output_format = dc.output_format * * if dict_data: # <<<<<<<<<<<<<< * #schema = None * # in polars if missing user values we need to explicitly set the type */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1064 + /* "pyreadstat/_readstat_parser.pyx":1069 * # in polars if missing user values we need to explicitly set the type * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: # <<<<<<<<<<<<<< * schema = dict() * for indx in range(0, len(dc.col_names)): */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dc->missing_user_values); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dc->missing_user_values); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1065 + /* "pyreadstat/_readstat_parser.pyx":1070 * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: * schema = dict() # <<<<<<<<<<<<<< * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1065, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_schema, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1066 + /* "pyreadstat/_readstat_parser.pyx":1071 * if output_format != "pandas" and dc.missing_user_values: * schema = dict() * for indx in range(0, len(dc.col_names)): # <<<<<<<<<<<<<< @@ -14402,15 +14511,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1066, __pyx_L1_error) + __PYX_ERR(0, 1071, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_indx = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1067 + /* "pyreadstat/_readstat_parser.pyx":1072 * schema = dict() * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] # <<<<<<<<<<<<<< @@ -14419,53 +14528,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1067, __pyx_L1_error) + __PYX_ERR(0, 1072, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_indx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_indx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1067, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_col_name, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1068 + /* "pyreadstat/_readstat_parser.pyx":1073 * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): # <<<<<<<<<<<<<< * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide */ - __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 1068, __pyx_L1_error) + __PYX_ERR(0, 1073, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_dc->missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_dc->missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1069 + /* "pyreadstat/_readstat_parser.pyx":1074 * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): * sertypes = [type(x) for x in dict_data[col_name] if x is not None] # <<<<<<<<<<<<<< * # all missing, let polars decide * if not sertypes: */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict_data, __pyx_v_col_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict_data, __pyx_v_col_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1074, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14474,7 +14583,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } @@ -14484,7 +14593,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } @@ -14495,13 +14604,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_9; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1069, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1069, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1074, __pyx_L1_error) PyErr_Clear(); } break; @@ -14512,14 +14621,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = 0; __pyx_t_1 = (__pyx_v_x != Py_None); if (__pyx_t_1) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)((PyObject *)Py_TYPE(__pyx_v_x))))) __PYX_ERR(0, 1069, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)((PyObject *)Py_TYPE(__pyx_v_x))))) __PYX_ERR(0, 1074, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_sertypes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1071 + /* "pyreadstat/_readstat_parser.pyx":1076 * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide * if not sertypes: # <<<<<<<<<<<<<< @@ -14528,23 +14637,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_sertypes); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1071, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1076, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 0); } __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1072 + /* "pyreadstat/_readstat_parser.pyx":1077 * # all missing, let polars decide * if not sertypes: * schema[col_name] = None # <<<<<<<<<<<<<< * continue * allsame = all([x==sertypes[0] for x in sertypes]) */ - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1073 + /* "pyreadstat/_readstat_parser.pyx":1078 * if not sertypes: * schema[col_name] = None * continue # <<<<<<<<<<<<<< @@ -14553,7 +14662,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ goto __pyx_L7_continue; - /* "pyreadstat/_readstat_parser.pyx":1071 + /* "pyreadstat/_readstat_parser.pyx":1076 * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide * if not sertypes: # <<<<<<<<<<<<<< @@ -14562,7 +14671,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1074 + /* "pyreadstat/_readstat_parser.pyx":1079 * schema[col_name] = None * continue * allsame = all([x==sertypes[0] for x in sertypes]) # <<<<<<<<<<<<<< @@ -14570,7 +14679,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if allsame: */ __pyx_t_8 = NULL; - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __pyx_v_sertypes; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0; @@ -14578,21 +14687,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } __pyx_t_12 = __Pyx_PyList_GetItemRefFast(__pyx_t_11, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_9; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1074, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_sertypes, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1074, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_sertypes, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = PyObject_RichCompare(__pyx_v_x, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1074, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_x, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 1074, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -14602,14 +14711,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_all, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1074, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1074, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_allsame = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":1076 + /* "pyreadstat/_readstat_parser.pyx":1081 * allsame = all([x==sertypes[0] for x in sertypes]) * # all the same: let polars decide * if allsame: # <<<<<<<<<<<<<< @@ -14618,16 +14727,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (__pyx_v_allsame) { - /* "pyreadstat/_readstat_parser.pyx":1077 + /* "pyreadstat/_readstat_parser.pyx":1082 * # all the same: let polars decide * if allsame: * schema[col_name] = None # <<<<<<<<<<<<<< * # not all the same type, has to be Object * else: */ - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1076 + /* "pyreadstat/_readstat_parser.pyx":1081 * allsame = all([x==sertypes[0] for x in sertypes]) * # all the same: let polars decide * if allsame: # <<<<<<<<<<<<<< @@ -14637,7 +14746,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":1080 + /* "pyreadstat/_readstat_parser.pyx":1085 * # not all the same type, has to be Object * else: * schema[col_name] = nw.Object # <<<<<<<<<<<<<< @@ -14645,17 +14754,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * schema[col_name] = None */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1080, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":1068 + /* "pyreadstat/_readstat_parser.pyx":1073 * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): # <<<<<<<<<<<<<< @@ -14665,7 +14774,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":1082 + /* "pyreadstat/_readstat_parser.pyx":1087 * schema[col_name] = nw.Object * else: * schema[col_name] = None # <<<<<<<<<<<<<< @@ -14673,13 +14782,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) */ /*else*/ { - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1087, __pyx_L1_error) } __pyx_L9:; __pyx_L7_continue:; } - /* "pyreadstat/_readstat_parser.pyx":1064 + /* "pyreadstat/_readstat_parser.pyx":1069 * # in polars if missing user values we need to explicitly set the type * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: # <<<<<<<<<<<<<< @@ -14688,7 +14797,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1084 + /* "pyreadstat/_readstat_parser.pyx":1089 * schema[col_name] = None * * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) # <<<<<<<<<<<<<< @@ -14696,9 +14805,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * data_frame = data_frame.to_native() */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1084, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = 1; @@ -14715,21 +14824,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_7, __pyx_v_dict_data}; - __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_8, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1084, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_schema, __pyx_t_8, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1084, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_8, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1089, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_schema, __pyx_t_8, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1089, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_data_frame = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1085 + /* "pyreadstat/_readstat_parser.pyx":1090 * * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) * natnamespace = nw.get_native_namespace(data_frame) # <<<<<<<<<<<<<< @@ -14737,9 +14846,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * */ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1085, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1085, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = 1; @@ -14759,13 +14868,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1085, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_natnamespace = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1086 + /* "pyreadstat/_readstat_parser.pyx":1091 * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) * natnamespace = nw.get_native_namespace(data_frame) * data_frame = data_frame.to_native() # <<<<<<<<<<<<<< @@ -14779,13 +14888,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1088 + /* "pyreadstat/_readstat_parser.pyx":1093 * data_frame = data_frame.to_native() * * if dates_as_pandas and output_format=="pandas": # <<<<<<<<<<<<<< @@ -14797,12 +14906,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = __pyx_v_dates_as_pandas; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1093, __pyx_L1_error) __pyx_t_3 = __pyx_t_1; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1089 + /* "pyreadstat/_readstat_parser.pyx":1094 * * if dates_as_pandas and output_format=="pandas": * pd = natnamespace # <<<<<<<<<<<<<< @@ -14812,14 +14921,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_v_natnamespace); __pyx_v_pd = __pyx_v_natnamespace; - /* "pyreadstat/_readstat_parser.pyx":1090 + /* "pyreadstat/_readstat_parser.pyx":1095 * if dates_as_pandas and output_format=="pandas": * pd = natnamespace * dtypes = data_frame.dtypes.tolist() # <<<<<<<<<<<<<< * # check that datetime columns are datetime type * # this is needed in case all date values are nan */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __pyx_t_11; __Pyx_INCREF(__pyx_t_7); @@ -14829,14 +14938,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 1090, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 1095, __pyx_L1_error) __pyx_v_dtypes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1093 + /* "pyreadstat/_readstat_parser.pyx":1098 * # check that datetime columns are datetime type * # this is needed in case all date values are nan * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -14844,16 +14953,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if dtypes[index] != '__pyx_n_u_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_11 = __pyx_t_2; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1098, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14862,7 +14971,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -14872,7 +14981,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -14883,26 +14992,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1098, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1093, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1098, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_index = __pyx_t_15; __pyx_t_15 = (__pyx_t_15 + 1); - /* "pyreadstat/_readstat_parser.pyx":1094 + /* "pyreadstat/_readstat_parser.pyx":1099 * # this is needed in case all date values are nan * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -14911,15 +15020,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1094, __pyx_L1_error) + __PYX_ERR(0, 1099, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_16 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_var_format = __pyx_t_16; - /* "pyreadstat/_readstat_parser.pyx":1095 + /* "pyreadstat/_readstat_parser.pyx":1100 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_kp_u_M8_ns, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_M8_ns, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { @@ -14952,7 +15061,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_L25_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1096 + /* "pyreadstat/_readstat_parser.pyx":1101 * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_n_u_to_datetime, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_loc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_loc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1096, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1101, __pyx_L1_error); __Pyx_INCREF(__pyx_v_column); __Pyx_GIVEREF(__pyx_v_column); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_column) != (0)) __PYX_ERR(0, 1096, __pyx_L1_error); - if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(0, 1096, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_column) != (0)) __PYX_ERR(0, 1101, __pyx_L1_error); + if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1095 + /* "pyreadstat/_readstat_parser.pyx":1100 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; @@ -15033,7 +15142,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_L29_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1100 + /* "pyreadstat/_readstat_parser.pyx":1105 * if output_format == "polars" and not dc.no_datetime_conversion: * # datetime and date vectorized conversion * pl = natnamespace # <<<<<<<<<<<<<< @@ -15043,31 +15152,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_v_natnamespace); __pyx_v_pl = __pyx_v_natnamespace; - /* "pyreadstat/_readstat_parser.pyx":1101 + /* "pyreadstat/_readstat_parser.pyx":1106 * # datetime and date vectorized conversion * pl = natnamespace * datetime_cols = list() # <<<<<<<<<<<<<< * date_cols = list() * for index, column in enumerate(data_frame.columns): */ - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_datetime_cols = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; - /* "pyreadstat/_readstat_parser.pyx":1102 + /* "pyreadstat/_readstat_parser.pyx":1107 * pl = natnamespace * datetime_cols = list() * date_cols = list() # <<<<<<<<<<<<<< * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] */ - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1102, __pyx_L1_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_date_cols = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; - /* "pyreadstat/_readstat_parser.pyx":1103 + /* "pyreadstat/_readstat_parser.pyx":1108 * datetime_cols = list() * date_cols = list() * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15075,16 +15184,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if var_format == DATE_FORMAT_DATETIME: */ __pyx_t_15 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) { __pyx_t_2 = __pyx_t_11; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1108, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -15093,7 +15202,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15103,7 +15212,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15114,26 +15223,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1108, __pyx_L1_error) } else { __pyx_t_11 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_11)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1108, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_11); - if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_11))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_11))) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; __pyx_v_index = __pyx_t_15; __pyx_t_15 = (__pyx_t_15 + 1); - /* "pyreadstat/_readstat_parser.pyx":1104 + /* "pyreadstat/_readstat_parser.pyx":1109 * date_cols = list() * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -15142,15 +15251,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1104, __pyx_L1_error) + __PYX_ERR(0, 1109, __pyx_L1_error) } - __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_16 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_16 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_var_format = __pyx_t_16; - /* "pyreadstat/_readstat_parser.pyx":1105 + /* "pyreadstat/_readstat_parser.pyx":1110 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -15160,16 +15269,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = (__pyx_v_var_format == __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1106 + /* "pyreadstat/_readstat_parser.pyx":1111 * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) # <<<<<<<<<<<<<< * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) */ - __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_datetime_cols, __pyx_v_column); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_datetime_cols, __pyx_v_column); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1111, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1105 + /* "pyreadstat/_readstat_parser.pyx":1110 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -15178,7 +15287,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1107 + /* "pyreadstat/_readstat_parser.pyx":1112 * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -15188,16 +15297,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = (__pyx_v_var_format == __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1108 + /* "pyreadstat/_readstat_parser.pyx":1113 * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) # <<<<<<<<<<<<<< * if datetime_cols: * data_frame = data_frame.with_columns( */ - __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_date_cols, __pyx_v_column); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_date_cols, __pyx_v_column); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1113, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1107 + /* "pyreadstat/_readstat_parser.pyx":1112 * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -15206,7 +15315,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1103 + /* "pyreadstat/_readstat_parser.pyx":1108 * datetime_cols = list() * date_cols = list() * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15216,7 +15325,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1109 + /* "pyreadstat/_readstat_parser.pyx":1114 * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) * if datetime_cols: # <<<<<<<<<<<<<< @@ -15225,13 +15334,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_datetime_cols); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1109, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1114, __pyx_L1_error) __pyx_t_3 = (__pyx_temp != 0); } if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1110 + /* "pyreadstat/_readstat_parser.pyx":1115 * date_cols.append(column) * if datetime_cols: * data_frame = data_frame.with_columns( # <<<<<<<<<<<<<< @@ -15241,17 +15350,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_11 = __pyx_v_data_frame; __Pyx_INCREF(__pyx_t_11); - /* "pyreadstat/_readstat_parser.pyx":1111 + /* "pyreadstat/_readstat_parser.pyx":1116 * if datetime_cols: * data_frame = data_frame.with_columns( * [ # <<<<<<<<<<<<<< * pl.from_epoch( * (pl.col(c) % 1 * 1e6).round().cast(pl.Int64) + ( */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1117 + /* "pyreadstat/_readstat_parser.pyx":1122 * pl.lit(dc.unix_to_origin_secs) * 1e6).cast(pl.Int64), * time_unit='us') * for c in datetime_cols if data_frame[c].len() > 0 # <<<<<<<<<<<<<< @@ -15264,17 +15373,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1117, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } __pyx_t_13 = __Pyx_PyList_GetItemRefFast(__pyx_t_8, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1117, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_data_frame, __pyx_v_c); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_data_frame, __pyx_v_c); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_12 = __pyx_t_18; __Pyx_INCREF(__pyx_t_12); @@ -15284,16 +15393,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_len, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1117, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_18 = PyObject_RichCompare(__pyx_t_13, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_18 = PyObject_RichCompare(__pyx_t_13, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1112 + /* "pyreadstat/_readstat_parser.pyx":1117 * data_frame = data_frame.with_columns( * [ * pl.from_epoch( # <<<<<<<<<<<<<< @@ -15303,7 +15412,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_13 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_13); - /* "pyreadstat/_readstat_parser.pyx":1113 + /* "pyreadstat/_readstat_parser.pyx":1118 * [ * pl.from_epoch( * (pl.col(c) % 1 * 1e6).round().cast(pl.Int64) + ( # <<<<<<<<<<<<<< @@ -15317,13 +15426,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_v_c}; __pyx_t_22 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_col, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; - if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1113, __pyx_L1_error) + if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); } - __pyx_t_23 = __Pyx_PyLong_RemainderObjC(__pyx_t_22, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyLong_RemainderObjC(__pyx_t_22, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = PyNumber_Multiply(__pyx_t_23, __pyx_mstate_global->__pyx_float_1e6); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_22 = PyNumber_Multiply(__pyx_t_23, __pyx_mstate_global->__pyx_float_1e6); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_21 = __pyx_t_22; @@ -15334,12 +15443,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_20 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1113, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); } __pyx_t_19 = __pyx_t_20; __Pyx_INCREF(__pyx_t_19); - __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_14 = 0; { @@ -15348,11 +15457,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1113, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - /* "pyreadstat/_readstat_parser.pyx":1114 + /* "pyreadstat/_readstat_parser.pyx":1119 * pl.from_epoch( * (pl.col(c) % 1 * 1e6).round().cast(pl.Int64) + ( * pl.col(c).floor() * 1e6).cast(pl.Int64) - ( # <<<<<<<<<<<<<< @@ -15366,7 +15475,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_v_c}; __pyx_t_23 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_col, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; - if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); } __pyx_t_21 = __pyx_t_23; @@ -15377,15 +15486,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_19 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_floor, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); } - __pyx_t_23 = PyNumber_Multiply(__pyx_t_19, __pyx_mstate_global->__pyx_float_1e6); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_23 = PyNumber_Multiply(__pyx_t_19, __pyx_mstate_global->__pyx_float_1e6); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_22 = __pyx_t_23; __Pyx_INCREF(__pyx_t_22); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 0; { @@ -15394,23 +15503,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1114, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); } - /* "pyreadstat/_readstat_parser.pyx":1113 + /* "pyreadstat/_readstat_parser.pyx":1118 * [ * pl.from_epoch( * (pl.col(c) % 1 * 1e6).round().cast(pl.Int64) + ( # <<<<<<<<<<<<<< * pl.col(c).floor() * 1e6).cast(pl.Int64) - ( * pl.lit(dc.unix_to_origin_secs) * 1e6).cast(pl.Int64), */ - __pyx_t_23 = PyNumber_Add(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_23 = PyNumber_Add(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - /* "pyreadstat/_readstat_parser.pyx":1115 + /* "pyreadstat/_readstat_parser.pyx":1120 * (pl.col(c) % 1 * 1e6).round().cast(pl.Int64) + ( * pl.col(c).floor() * 1e6).cast(pl.Int64) - ( * pl.lit(dc.unix_to_origin_secs) * 1e6).cast(pl.Int64), # <<<<<<<<<<<<<< @@ -15419,7 +15528,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ __pyx_t_22 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_22); - __pyx_t_21 = PyFloat_FromDouble(__pyx_v_dc->unix_to_origin_secs); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_21 = PyFloat_FromDouble(__pyx_v_dc->unix_to_origin_secs); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_14 = 0; { @@ -15427,15 +15536,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_19 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lit, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); } - __pyx_t_21 = PyNumber_Multiply(__pyx_t_19, __pyx_mstate_global->__pyx_float_1e6); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_21 = PyNumber_Multiply(__pyx_t_19, __pyx_mstate_global->__pyx_float_1e6); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_12 = __pyx_t_21; __Pyx_INCREF(__pyx_t_12); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 0; { @@ -15444,38 +15553,38 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); } - /* "pyreadstat/_readstat_parser.pyx":1114 + /* "pyreadstat/_readstat_parser.pyx":1119 * pl.from_epoch( * (pl.col(c) % 1 * 1e6).round().cast(pl.Int64) + ( * pl.col(c).floor() * 1e6).cast(pl.Int64) - ( # <<<<<<<<<<<<<< * pl.lit(dc.unix_to_origin_secs) * 1e6).cast(pl.Int64), * time_unit='us') */ - __pyx_t_21 = PyNumber_Subtract(__pyx_t_23, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_21 = PyNumber_Subtract(__pyx_t_23, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_14 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_13, __pyx_t_21}; - __pyx_t_20 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_20 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_us, __pyx_t_20, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_us, __pyx_t_20, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1117, __pyx_L1_error) __pyx_t_18 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_from_epoch, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_20); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1112, __pyx_L1_error) + if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_18))) __PYX_ERR(0, 1111, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_18))) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - /* "pyreadstat/_readstat_parser.pyx":1117 + /* "pyreadstat/_readstat_parser.pyx":1122 * pl.lit(dc.unix_to_origin_secs) * 1e6).cast(pl.Int64), * time_unit='us') * for c in datetime_cols if data_frame[c].len() > 0 # <<<<<<<<<<<<<< @@ -15491,13 +15600,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1109 + /* "pyreadstat/_readstat_parser.pyx":1114 * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) * if datetime_cols: # <<<<<<<<<<<<<< @@ -15506,7 +15615,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1120 + /* "pyreadstat/_readstat_parser.pyx":1125 * ] * ) * if date_cols: # <<<<<<<<<<<<<< @@ -15515,13 +15624,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_date_cols); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1120, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1125, __pyx_L1_error) __pyx_t_3 = (__pyx_temp != 0); } if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1121 + /* "pyreadstat/_readstat_parser.pyx":1126 * ) * if date_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*date_cols), time_unit='d')) # <<<<<<<<<<<<<< @@ -15532,25 +15641,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_8); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_20 = PySequence_Tuple(__pyx_v_date_cols); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_20 = PySequence_Tuple(__pyx_v_date_cols); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_20, NULL); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_20, NULL); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_14 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_21}; - __pyx_t_20 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_20 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_d, __pyx_t_20, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1121, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_d, __pyx_t_20, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1126, __pyx_L1_error) __pyx_t_11 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_from_epoch, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_20); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1121, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_14 = 0; @@ -15559,13 +15668,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1120 + /* "pyreadstat/_readstat_parser.pyx":1125 * ] * ) * if date_cols: # <<<<<<<<<<<<<< @@ -15574,7 +15683,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1098 + /* "pyreadstat/_readstat_parser.pyx":1103 * data_frame.loc[:, column] = pd.to_datetime(data_frame[column]) * * if output_format == "polars" and not dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -15583,7 +15692,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1060 + /* "pyreadstat/_readstat_parser.pyx":1065 * output_format = dc.output_format * * if dict_data: # <<<<<<<<<<<<<< @@ -15593,7 +15702,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1124 + /* "pyreadstat/_readstat_parser.pyx":1129 * * else: * data_frame = nw.from_dict(dict_data, backend=output_format).to_native() # <<<<<<<<<<<<<< @@ -15602,9 +15711,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ /*else*/ { __pyx_t_20 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_14 = 1; @@ -15621,14 +15730,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_20, __pyx_v_dict_data}; - __pyx_t_21 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_21 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_21, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_21, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1129, __pyx_L1_error) __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_21); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_11 = __pyx_t_7; @@ -15639,7 +15748,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_data_frame = __pyx_t_2; @@ -15647,7 +15756,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1126 + /* "pyreadstat/_readstat_parser.pyx":1131 * data_frame = nw.from_dict(dict_data, backend=output_format).to_native() * * return data_frame # <<<<<<<<<<<<<< @@ -15659,7 +15768,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_r = __pyx_v_data_frame; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1045 + /* "pyreadstat/_readstat_parser.pyx":1050 * return final_container * * cdef object dict_to_dataframe(object dict_data, data_container dc): # <<<<<<<<<<<<<< @@ -15704,7 +15813,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1128 +/* "pyreadstat/_readstat_parser.pyx":1133 * return data_frame * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -15719,15 +15828,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_v_labels_raw = 0; PyObject *__pyx_v_var_name = 0; PyObject *__pyx_v_var_label = 0; + PyObject *__pyx_v_cur_type = 0; + PyObject *__pyx_v_cur_informat = 0; PyObject *__pyx_v_current_labels = 0; PyObject *__pyx_v_original_types = 0; + PyObject *__pyx_v_original_informats = 0; readstat_type_t __pyx_v_var_type; PyObject *__pyx_v_metadata = 0; PyObject *__pyx_v_variable_value_labels = NULL; PyObject *__pyx_v_readstat_types = NULL; PyObject *__pyx_v_indx = NULL; PyObject *__pyx_v_cur_col = NULL; - PyObject *__pyx_v_cur_type = NULL; PyObject *__pyx_v_curset = NULL; PyObject *__pyx_7genexpr__pyx_v_k = NULL; PyObject *__pyx_7genexpr__pyx_v_v = NULL; @@ -15750,7 +15861,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_extract_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":1145 + /* "pyreadstat/_readstat_parser.pyx":1150 * cdef readstat_type_t var_type * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -15760,7 +15871,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1146 + /* "pyreadstat/_readstat_parser.pyx":1151 * * metaonly = data.metaonly * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -15770,7 +15881,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1148 + /* "pyreadstat/_readstat_parser.pyx":1153 * is_unkown_number_rows = data.is_unkown_number_rows * * cdef object metadata = metadata_container() # <<<<<<<<<<<<<< @@ -15778,7 +15889,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # mr sets */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -15797,13 +15908,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_metadata = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1151 + /* "pyreadstat/_readstat_parser.pyx":1156 * * # mr sets * metadata.mr_sets = data.mr_sets # <<<<<<<<<<<<<< @@ -15812,22 +15923,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->mr_sets; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_2) < (0)) __PYX_ERR(0, 1151, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_2) < (0)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1154 + /* "pyreadstat/_readstat_parser.pyx":1159 * * # number of rows * metadata.number_columns = data.n_vars # <<<<<<<<<<<<<< * if is_unkown_number_rows: * if not metaonly: */ - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns, __pyx_t_2) < (0)) __PYX_ERR(0, 1154, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns, __pyx_t_2) < (0)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1155 + /* "pyreadstat/_readstat_parser.pyx":1160 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -15836,7 +15947,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (__pyx_v_is_unkown_number_rows) { - /* "pyreadstat/_readstat_parser.pyx":1156 + /* "pyreadstat/_readstat_parser.pyx":1161 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -15846,19 +15957,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = (!__pyx_v_metaonly); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1157 + /* "pyreadstat/_readstat_parser.pyx":1162 * if is_unkown_number_rows: * if not metaonly: * metadata.number_rows = data.max_n_obs # <<<<<<<<<<<<<< * else: * metadata.number_rows = data.n_obs */ - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < (0)) __PYX_ERR(0, 1157, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < (0)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1156 + /* "pyreadstat/_readstat_parser.pyx":1161 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -15867,7 +15978,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1155 + /* "pyreadstat/_readstat_parser.pyx":1160 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -15877,7 +15988,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1159 + /* "pyreadstat/_readstat_parser.pyx":1164 * metadata.number_rows = data.max_n_obs * else: * metadata.number_rows = data.n_obs # <<<<<<<<<<<<<< @@ -15885,14 +15996,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # value labels */ /*else*/ { - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < (0)) __PYX_ERR(0, 1159, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < (0)) __PYX_ERR(0, 1164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1162 + /* "pyreadstat/_readstat_parser.pyx":1167 * * # value labels * labels_raw = data.labels_raw # <<<<<<<<<<<<<< @@ -15904,7 +16015,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_labels_raw = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1163 + /* "pyreadstat/_readstat_parser.pyx":1168 * # value labels * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name # <<<<<<<<<<<<<< @@ -15916,29 +16027,29 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_label_to_var_name = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1164 + /* "pyreadstat/_readstat_parser.pyx":1169 * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name * variable_value_labels = dict() # <<<<<<<<<<<<<< * * if labels_raw: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_variable_value_labels = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1166 + /* "pyreadstat/_readstat_parser.pyx":1171 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1167 + /* "pyreadstat/_readstat_parser.pyx":1172 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -15952,7 +16063,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_items, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -15960,9 +16071,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1167, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1172, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -15971,7 +16082,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -15981,7 +16092,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -15992,13 +16103,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1172, __pyx_L1_error) PyErr_Clear(); } break; @@ -16011,7 +16122,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1167, __pyx_L1_error) + __PYX_ERR(0, 1172, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16021,22 +16132,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1167, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1172, __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, 1167, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -16044,7 +16155,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1167, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1172, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -16052,17 +16163,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1167, __pyx_L1_error) + __PYX_ERR(0, 1172, __pyx_L1_error) __pyx_L9_unpacking_done:; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1167, __pyx_L1_error) - if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1167, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1172, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1172, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_var_name, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_var_label, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1168 + /* "pyreadstat/_readstat_parser.pyx":1173 * if labels_raw: * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) # <<<<<<<<<<<<<< @@ -16076,32 +16187,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_var_label}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_current_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1169 + /* "pyreadstat/_readstat_parser.pyx":1174 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< * variable_value_labels[var_name] = current_labels * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1170 + /* "pyreadstat/_readstat_parser.pyx":1175 * current_labels = labels_raw.get(var_label) * if current_labels: * variable_value_labels[var_name] = current_labels # <<<<<<<<<<<<<< * * original_types = dict() */ - if (unlikely((PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0))) __PYX_ERR(0, 1175, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1169 + /* "pyreadstat/_readstat_parser.pyx":1174 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< @@ -16110,7 +16221,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1167 + /* "pyreadstat/_readstat_parser.pyx":1172 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -16120,7 +16231,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1166 + /* "pyreadstat/_readstat_parser.pyx":1171 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< @@ -16129,39 +16240,51 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1172 + /* "pyreadstat/_readstat_parser.pyx":1177 * variable_value_labels[var_name] = current_labels * * original_types = dict() # <<<<<<<<<<<<<< + * original_informats = dict() * readstat_types = dict() - * for indx in range(metadata.number_columns): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_original_types = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1173 + /* "pyreadstat/_readstat_parser.pyx":1178 * * original_types = dict() + * original_informats = dict() # <<<<<<<<<<<<<< + * readstat_types = dict() + * for indx in range(metadata.number_columns): +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_original_informats = __pyx_t_4; + __pyx_t_4 = 0; + + /* "pyreadstat/_readstat_parser.pyx":1179 + * original_types = dict() + * original_informats = dict() * readstat_types = dict() # <<<<<<<<<<<<<< * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_readstat_types = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1174 - * original_types = dict() + /* "pyreadstat/_readstat_parser.pyx":1180 + * original_informats = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] */ __pyx_t_2 = NULL; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = 1; { @@ -16169,12 +16292,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { { @@ -16182,7 +16305,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1180, __pyx_L1_error) PyErr_Clear(); } break; @@ -16192,7 +16315,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1175 + /* "pyreadstat/_readstat_parser.pyx":1181 * readstat_types = dict() * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -16201,57 +16324,84 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1175, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1176 + /* "pyreadstat/_readstat_parser.pyx":1182 * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] # <<<<<<<<<<<<<< * original_types[cur_col] = cur_type - * var_type = data.col_dtypes[indx] + * cur_informat = data.col_informats_original[indx] */ if (unlikely(__pyx_v_data->col_formats_original == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1176, __pyx_L1_error) + __PYX_ERR(0, 1182, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_cur_type, __pyx_t_4); + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_cur_type, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1177 + /* "pyreadstat/_readstat_parser.pyx":1183 * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type # <<<<<<<<<<<<<< + * cur_informat = data.col_informats_original[indx] + * original_informats[cur_col] = cur_informat +*/ + if (unlikely((PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + + /* "pyreadstat/_readstat_parser.pyx":1184 + * cur_type = data.col_formats_original[indx] + * original_types[cur_col] = cur_type + * cur_informat = data.col_informats_original[indx] # <<<<<<<<<<<<<< + * original_informats[cur_col] = cur_informat + * var_type = data.col_dtypes[indx] +*/ + if (unlikely(__pyx_v_data->col_informats_original == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 1184, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_informats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 1184, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_cur_informat, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "pyreadstat/_readstat_parser.pyx":1185 + * original_types[cur_col] = cur_type + * cur_informat = data.col_informats_original[indx] + * original_informats[cur_col] = cur_informat # <<<<<<<<<<<<<< * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: */ - if (unlikely((PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0))) __PYX_ERR(0, 1177, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_original_informats, __pyx_v_cur_col, __pyx_v_cur_informat) < 0))) __PYX_ERR(0, 1185, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1178 - * cur_type = data.col_formats_original[indx] - * original_types[cur_col] = cur_type + /* "pyreadstat/_readstat_parser.pyx":1186 + * cur_informat = data.col_informats_original[indx] + * original_informats[cur_col] = cur_informat * var_type = data.col_dtypes[indx] # <<<<<<<<<<<<<< * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" */ if (unlikely(__pyx_v_data->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1178, __pyx_L1_error) + __PYX_ERR(0, 1186, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_11 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_var_type = __pyx_t_11; - /* "pyreadstat/_readstat_parser.pyx":1179 - * original_types[cur_col] = cur_type + /* "pyreadstat/_readstat_parser.pyx":1187 + * original_informats[cur_col] = cur_informat * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< * readstat_types[cur_col] = "string" @@ -16261,17 +16411,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":1180 + /* "pyreadstat/_readstat_parser.pyx":1188 * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_string) < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_string) < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1179 - * original_types[cur_col] = cur_type + /* "pyreadstat/_readstat_parser.pyx":1187 + * original_informats[cur_col] = cur_informat * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< * readstat_types[cur_col] = "string" @@ -16280,16 +16430,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":1182 + /* "pyreadstat/_readstat_parser.pyx":1190 * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int8) < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int8) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1181 + /* "pyreadstat/_readstat_parser.pyx":1189 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -16299,16 +16449,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":1184 + /* "pyreadstat/_readstat_parser.pyx":1192 * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int16) < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int16) < 0))) __PYX_ERR(0, 1192, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1183 + /* "pyreadstat/_readstat_parser.pyx":1191 * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -16318,16 +16468,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":1186 + /* "pyreadstat/_readstat_parser.pyx":1194 * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int32) < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int32) < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1185 + /* "pyreadstat/_readstat_parser.pyx":1193 * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -16337,16 +16487,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":1188 + /* "pyreadstat/_readstat_parser.pyx":1196 * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_float) < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_float) < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1187 + /* "pyreadstat/_readstat_parser.pyx":1195 * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -16356,16 +16506,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":1190 + /* "pyreadstat/_readstat_parser.pyx":1198 * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unkown data type") */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_double) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_double) < 0))) __PYX_ERR(0, 1198, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1189 + /* "pyreadstat/_readstat_parser.pyx":1197 * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -16375,7 +16525,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; default: - /* "pyreadstat/_readstat_parser.pyx":1192 + /* "pyreadstat/_readstat_parser.pyx":1200 * readstat_types[cur_col] = "double" * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -16383,7 +16533,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * for indx, curset in data.missing_user_values.items(): */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -16402,17 +16552,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 1192, __pyx_L1_error) + __PYX_ERR(0, 1200, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1174 - * original_types = dict() + /* "pyreadstat/_readstat_parser.pyx":1180 + * original_informats = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< * cur_col = data.col_names[indx] @@ -16421,7 +16571,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1194 + /* "pyreadstat/_readstat_parser.pyx":1202 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -16430,18 +16580,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1194, __pyx_L1_error) + __PYX_ERR(0, 1202, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1202, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -16450,7 +16600,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16460,7 +16610,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16471,13 +16621,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1202, __pyx_L1_error) PyErr_Clear(); } break; @@ -16490,7 +16640,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1194, __pyx_L1_error) + __PYX_ERR(0, 1202, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16500,22 +16650,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -16523,7 +16673,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1194, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1202, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; @@ -16531,7 +16681,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1194, __pyx_L1_error) + __PYX_ERR(0, 1202, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_3); @@ -16539,7 +16689,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_curset, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1195 + /* "pyreadstat/_readstat_parser.pyx":1203 * * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -16548,33 +16698,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1195, __pyx_L1_error) + __PYX_ERR(0, 1203, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1195, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1196 + /* "pyreadstat/_readstat_parser.pyx":1204 * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] * metadata.missing_user_values[cur_col] = sorted(list(curset)) # <<<<<<<<<<<<<< * * metadata.notes = data.notes */ - __pyx_t_8 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_t_8 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely((PyList_Sort(__pyx_t_2) < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1196, __pyx_L1_error) + if (unlikely((PyList_Sort(__pyx_t_2) < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_v_cur_col, __pyx_t_2) < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_v_cur_col, __pyx_t_2) < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1194 + /* "pyreadstat/_readstat_parser.pyx":1202 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -16584,7 +16734,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1198 + /* "pyreadstat/_readstat_parser.pyx":1206 * metadata.missing_user_values[cur_col] = sorted(list(curset)) * * metadata.notes = data.notes # <<<<<<<<<<<<<< @@ -16593,10 +16743,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->notes; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_4) < (0)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_4) < (0)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1199 + /* "pyreadstat/_readstat_parser.pyx":1207 * * metadata.notes = data.notes * metadata.column_names = data.col_names # <<<<<<<<<<<<<< @@ -16605,10 +16755,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->col_names; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_4) < (0)) __PYX_ERR(0, 1199, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_4) < (0)) __PYX_ERR(0, 1207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1200 + /* "pyreadstat/_readstat_parser.pyx":1208 * metadata.notes = data.notes * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels # <<<<<<<<<<<<<< @@ -16617,10 +16767,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->col_labels; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_4) < (0)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_4) < (0)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1201 + /* "pyreadstat/_readstat_parser.pyx":1209 * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} # <<<<<<<<<<<<<< @@ -16628,7 +16778,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * metadata.file_label = data.file_label */ { /* enter inner scope */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L22_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 1; @@ -16636,7 +16786,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_data->col_names, __pyx_v_data->col_labels}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -16644,9 +16794,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L22_error) + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1201, __pyx_L22_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1209, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -16655,7 +16805,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1209, __pyx_L22_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16665,7 +16815,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1209, __pyx_L22_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16676,13 +16826,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L22_error) } else { __pyx_t_2 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1209, __pyx_L22_error) PyErr_Clear(); } break; @@ -16695,7 +16845,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1201, __pyx_L22_error) + __PYX_ERR(0, 1209, __pyx_L22_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16705,22 +16855,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L22_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1201, __pyx_L22_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1201, __pyx_L22_error) + __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1209, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); @@ -16728,7 +16878,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L25_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_12), 2) < (0)) __PYX_ERR(0, 1201, __pyx_L22_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_12), 2) < (0)) __PYX_ERR(0, 1209, __pyx_L22_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L26_unpacking_done; @@ -16736,14 +16886,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1201, __pyx_L22_error) + __PYX_ERR(0, 1209, __pyx_L22_error) __pyx_L26_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 1201, __pyx_L22_error) + if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 1209, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; @@ -16755,10 +16905,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L1_error; __pyx_L28_exit_scope:; } /* exit inner scope */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_4) < (0)) __PYX_ERR(0, 1201, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_4) < (0)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1202 + /* "pyreadstat/_readstat_parser.pyx":1210 * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding # <<<<<<<<<<<<<< @@ -16767,10 +16917,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->file_encoding; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_encoding, __pyx_t_4) < (0)) __PYX_ERR(0, 1202, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_encoding, __pyx_t_4) < (0)) __PYX_ERR(0, 1210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1203 + /* "pyreadstat/_readstat_parser.pyx":1211 * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label # <<<<<<<<<<<<<< @@ -16779,56 +16929,65 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->file_label; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_label, __pyx_t_4) < (0)) __PYX_ERR(0, 1203, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_label, __pyx_t_4) < (0)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1204 + /* "pyreadstat/_readstat_parser.pyx":1212 * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels # <<<<<<<<<<<<<< * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_v_variable_value_labels) < (0)) __PYX_ERR(0, 1204, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_v_variable_value_labels) < (0)) __PYX_ERR(0, 1212, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1205 + /* "pyreadstat/_readstat_parser.pyx":1213 * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw # <<<<<<<<<<<<<< * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_v_labels_raw) < (0)) __PYX_ERR(0, 1205, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_v_labels_raw) < (0)) __PYX_ERR(0, 1213, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1206 + /* "pyreadstat/_readstat_parser.pyx":1214 * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name # <<<<<<<<<<<<<< * metadata.original_variable_types = original_types - * metadata.readstat_variable_types = readstat_types + * metadata.original_variable_informats = original_informats */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_v_label_to_var_name) < (0)) __PYX_ERR(0, 1206, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_v_label_to_var_name) < (0)) __PYX_ERR(0, 1214, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1207 + /* "pyreadstat/_readstat_parser.pyx":1215 * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types # <<<<<<<<<<<<<< + * metadata.original_variable_informats = original_informats * metadata.readstat_variable_types = readstat_types - * metadata.table_name = data.table_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_v_original_types) < (0)) __PYX_ERR(0, 1207, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_v_original_types) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1208 + /* "pyreadstat/_readstat_parser.pyx":1216 * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types + * metadata.original_variable_informats = original_informats # <<<<<<<<<<<<<< + * metadata.readstat_variable_types = readstat_types + * metadata.table_name = data.table_name +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_informats, __pyx_v_original_informats) < (0)) __PYX_ERR(0, 1216, __pyx_L1_error) + + /* "pyreadstat/_readstat_parser.pyx":1217 + * metadata.original_variable_types = original_types + * metadata.original_variable_informats = original_informats * metadata.readstat_variable_types = readstat_types # <<<<<<<<<<<<<< * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_v_readstat_types) < (0)) __PYX_ERR(0, 1208, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_v_readstat_types) < (0)) __PYX_ERR(0, 1217, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1209 - * metadata.original_variable_types = original_types + /* "pyreadstat/_readstat_parser.pyx":1218 + * metadata.original_variable_informats = original_informats * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name # <<<<<<<<<<<<<< * metadata.missing_ranges = data.missing_ranges @@ -16836,10 +16995,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->table_name; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_table_name, __pyx_t_4) < (0)) __PYX_ERR(0, 1209, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_table_name, __pyx_t_4) < (0)) __PYX_ERR(0, 1218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1210 + /* "pyreadstat/_readstat_parser.pyx":1219 * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges # <<<<<<<<<<<<<< @@ -16848,10 +17007,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->missing_ranges; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_4) < (0)) __PYX_ERR(0, 1210, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_4) < (0)) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1211 + /* "pyreadstat/_readstat_parser.pyx":1220 * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width # <<<<<<<<<<<<<< @@ -16860,10 +17019,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_storage_width; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_4) < (0)) __PYX_ERR(0, 1211, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_4) < (0)) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1212 + /* "pyreadstat/_readstat_parser.pyx":1221 * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width # <<<<<<<<<<<<<< @@ -16872,10 +17031,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_display_width; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_4) < (0)) __PYX_ERR(0, 1212, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_4) < (0)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1213 + /* "pyreadstat/_readstat_parser.pyx":1222 * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment # <<<<<<<<<<<<<< @@ -16884,10 +17043,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_alignment; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_4) < (0)) __PYX_ERR(0, 1213, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_4) < (0)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1214 + /* "pyreadstat/_readstat_parser.pyx":1223 * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure # <<<<<<<<<<<<<< @@ -16896,24 +17055,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_measure; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_4) < (0)) __PYX_ERR(0, 1214, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_4) < (0)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1215 + /* "pyreadstat/_readstat_parser.pyx":1224 * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure * metadata.creation_time = datetime.datetime.fromtimestamp(data.ctime) # <<<<<<<<<<<<<< * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1215, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->ctime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->ctime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 0; { @@ -16922,27 +17081,27 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_creation_time, __pyx_t_4) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_creation_time, __pyx_t_4) < (0)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1216 + /* "pyreadstat/_readstat_parser.pyx":1225 * metadata.variable_measure = data.variable_measure * metadata.creation_time = datetime.datetime.fromtimestamp(data.ctime) * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) # <<<<<<<<<<<<<< * * return metadata */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1216, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->mtime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->mtime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 0; { @@ -16951,13 +17110,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_modification_time, __pyx_t_4) < (0)) __PYX_ERR(0, 1216, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_modification_time, __pyx_t_4) < (0)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1218 + /* "pyreadstat/_readstat_parser.pyx":1227 * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) * * return metadata # <<<<<<<<<<<<<< @@ -16969,7 +17128,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_r = __pyx_v_metadata; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1128 + /* "pyreadstat/_readstat_parser.pyx":1133 * return data_frame * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -16992,14 +17151,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_v_labels_raw); __Pyx_XDECREF(__pyx_v_var_name); __Pyx_XDECREF(__pyx_v_var_label); + __Pyx_XDECREF(__pyx_v_cur_type); + __Pyx_XDECREF(__pyx_v_cur_informat); __Pyx_XDECREF(__pyx_v_current_labels); __Pyx_XDECREF(__pyx_v_original_types); + __Pyx_XDECREF(__pyx_v_original_informats); __Pyx_XDECREF(__pyx_v_metadata); __Pyx_XDECREF(__pyx_v_variable_value_labels); __Pyx_XDECREF(__pyx_v_readstat_types); __Pyx_XDECREF(__pyx_v_indx); __Pyx_XDECREF(__pyx_v_cur_col); - __Pyx_XDECREF(__pyx_v_cur_type); __Pyx_XDECREF(__pyx_v_curset); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); @@ -17008,7 +17169,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1221 +/* "pyreadstat/_readstat_parser.pyx":1230 * * * cdef object run_conversion(object filename_path, py_file_format file_format, py_file_extension file_extension, # <<<<<<<<<<<<<< @@ -17064,7 +17225,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_RefNannySetupContext("run_conversion", 0); __Pyx_INCREF(__pyx_v_output_format); - /* "pyreadstat/_readstat_parser.pyx":1240 + /* "pyreadstat/_readstat_parser.pyx":1249 * cdef object data_dict * cdef object data_frame * cdef object file_obj = None # <<<<<<<<<<<<<< @@ -17074,25 +17235,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(Py_None); __pyx_v_file_obj = Py_None; - /* "pyreadstat/_readstat_parser.pyx":1243 + /* "pyreadstat/_readstat_parser.pyx":1252 * * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): # <<<<<<<<<<<<<< * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used */ - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1252, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1252, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1244 + /* "pyreadstat/_readstat_parser.pyx":1253 * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): * file_obj = filename_path # <<<<<<<<<<<<<< @@ -17102,7 +17263,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_filename_path); __Pyx_DECREF_SET(__pyx_v_file_obj, __pyx_v_filename_path); - /* "pyreadstat/_readstat_parser.pyx":1245 + /* "pyreadstat/_readstat_parser.pyx":1254 * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used # <<<<<<<<<<<<<< @@ -17112,7 +17273,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_); __pyx_v_filename_bytes = __pyx_mstate_global->__pyx_kp_b_; - /* "pyreadstat/_readstat_parser.pyx":1243 + /* "pyreadstat/_readstat_parser.pyx":1252 * * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): # <<<<<<<<<<<<<< @@ -17122,20 +17283,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1246 + /* "pyreadstat/_readstat_parser.pyx":1255 * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_bytes = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1247 + /* "pyreadstat/_readstat_parser.pyx":1256 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17151,7 +17312,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1248 + /* "pyreadstat/_readstat_parser.pyx":1257 * elif hasattr(os, 'fsencode'): * try: * filename_bytes = os.fsencode(filename_path) # <<<<<<<<<<<<<< @@ -17159,9 +17320,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1248, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1248, __pyx_L6_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1257, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = 1; @@ -17181,14 +17342,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1248, __pyx_L6_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); } - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 1248, __pyx_L6_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 1257, __pyx_L6_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1247 + /* "pyreadstat/_readstat_parser.pyx":1256 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17206,7 +17367,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1249 + /* "pyreadstat/_readstat_parser.pyx":1258 * try: * filename_bytes = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -17216,12 +17377,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_UnicodeError)))); if (__pyx_t_11) { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1249, __pyx_L8_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1258, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1250 + /* "pyreadstat/_readstat_parser.pyx":1259 * filename_bytes = os.fsencode(filename_path) * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) # <<<<<<<<<<<<<< @@ -17229,15 +17390,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * else: */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_15 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_10 = 1; @@ -17257,10 +17418,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_17 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + __pyx_t_17 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = 1; @@ -17281,12 +17442,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1250, __pyx_L8_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1259, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1251 + /* "pyreadstat/_readstat_parser.pyx":1260 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< @@ -17294,9 +17455,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if type(filename_path) == str: */ __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1251, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1260, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1251, __pyx_L8_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1260, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_10 = 1; @@ -17316,16 +17477,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L8_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1251, __pyx_L8_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1260, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L8_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 1251, __pyx_L8_except_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 1260, __pyx_L8_except_error) __Pyx_XDECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17335,7 +17496,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } goto __pyx_L8_except_error; - /* "pyreadstat/_readstat_parser.pyx":1247 + /* "pyreadstat/_readstat_parser.pyx":1256 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17356,7 +17517,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L11_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1246 + /* "pyreadstat/_readstat_parser.pyx":1255 * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< @@ -17366,7 +17527,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1253 + /* "pyreadstat/_readstat_parser.pyx":1262 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -17374,12 +17535,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1253, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1253, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1262, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1254 + /* "pyreadstat/_readstat_parser.pyx":1263 * else: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -17393,14 +17554,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1254, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1254, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1263, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1253 + /* "pyreadstat/_readstat_parser.pyx":1262 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -17410,19 +17571,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":1255 + /* "pyreadstat/_readstat_parser.pyx":1264 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1255, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1255, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1256 + /* "pyreadstat/_readstat_parser.pyx":1265 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< @@ -17431,11 +17592,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_t_7 = __pyx_v_filename_path; __Pyx_INCREF(__pyx_t_7); - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1256, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1265, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1255 + /* "pyreadstat/_readstat_parser.pyx":1264 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< @@ -17445,7 +17606,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":1258 + /* "pyreadstat/_readstat_parser.pyx":1267 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -17454,7 +17615,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*else*/ { __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17473,16 +17634,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1258, __pyx_L1_error) + __PYX_ERR(0, 1267, __pyx_L1_error) } __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":1259 + /* "pyreadstat/_readstat_parser.pyx":1268 * else: * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): # <<<<<<<<<<<<<< @@ -17491,24 +17652,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_filename_path))); __pyx_t_7 = ((PyObject *)Py_TYPE(__pyx_v_filename_path)); - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L16_bool_binop_done:; @@ -17516,7 +17677,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_2 = __pyx_t_1; if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":1260 + /* "pyreadstat/_readstat_parser.pyx":1269 * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): * raise PyreadstatError("path must be str, bytes or unicode") # <<<<<<<<<<<<<< @@ -17524,7 +17685,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1260, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17543,14 +17704,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1260, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1260, __pyx_L1_error) + __PYX_ERR(0, 1269, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1259 + /* "pyreadstat/_readstat_parser.pyx":1268 * else: * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): # <<<<<<<<<<<<<< @@ -17559,7 +17720,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1261 + /* "pyreadstat/_readstat_parser.pyx":1270 * if type(filename_path) not in (str, bytes, unicode): * raise PyreadstatError("path must be str, bytes or unicode") * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -17573,16 +17734,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1261, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1261, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1264 + /* "pyreadstat/_readstat_parser.pyx":1273 * * # Only check file existence for path-based reads * if file_obj is None: # <<<<<<<<<<<<<< @@ -17592,16 +17753,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_2 = (__pyx_v_file_obj == Py_None); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":1265 + /* "pyreadstat/_readstat_parser.pyx":1274 * # Only check file existence for path-based reads * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) # <<<<<<<<<<<<<< * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_8; @@ -17612,23 +17773,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_expanduser, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1265, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1265, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1266 + /* "pyreadstat/_readstat_parser.pyx":1275 * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __pyx_t_3; @@ -17639,15 +17800,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isfile, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1266, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (!__pyx_t_2); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1267 + /* "pyreadstat/_readstat_parser.pyx":1276 * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) # <<<<<<<<<<<<<< @@ -17655,7 +17816,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if output_format is None: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_File_0_does_not_exist; __Pyx_INCREF(__pyx_t_12); @@ -17664,7 +17825,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_filename_path}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1267, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_10 = 1; @@ -17685,14 +17846,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1267, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1267, __pyx_L1_error) + __PYX_ERR(0, 1276, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1266 + /* "pyreadstat/_readstat_parser.pyx":1275 * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< @@ -17701,7 +17862,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1264 + /* "pyreadstat/_readstat_parser.pyx":1273 * * # Only check file existence for path-based reads * if file_obj is None: # <<<<<<<<<<<<<< @@ -17710,7 +17871,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1269 + /* "pyreadstat/_readstat_parser.pyx":1278 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -17720,7 +17881,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_output_format == ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1270 + /* "pyreadstat/_readstat_parser.pyx":1279 * * if output_format is None: * output_format = 'pandas' # <<<<<<<<<<<<<< @@ -17730,7 +17891,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_pandas); __Pyx_DECREF_SET(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas); - /* "pyreadstat/_readstat_parser.pyx":1269 + /* "pyreadstat/_readstat_parser.pyx":1278 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -17739,32 +17900,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1271 + /* "pyreadstat/_readstat_parser.pyx":1280 * if output_format is None: * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} # <<<<<<<<<<<<<< * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) */ - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pandas) < (0)) __PYX_ERR(0, 1271, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1271, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_polars) < (0)) __PYX_ERR(0, 1271, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pandas) < (0)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_polars) < (0)) __PYX_ERR(0, 1280, __pyx_L1_error) __pyx_v_allowed_formats = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1272 + /* "pyreadstat/_readstat_parser.pyx":1281 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": */ - __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1272, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1273 + /* "pyreadstat/_readstat_parser.pyx":1282 * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) # <<<<<<<<<<<<<< @@ -17772,21 +17933,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * try: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1273, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_output_format_must_be_one_of_all; __Pyx_INCREF(__pyx_t_12); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_12, NULL}; - __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1273, __pyx_L1_error) + __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allowed_formats, __pyx_v_allowed_formats, __pyx_t_14, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1273, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_format, __pyx_v_output_format, __pyx_t_14, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1273, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allowed_formats, __pyx_v_allowed_formats, __pyx_t_14, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1282, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_format, __pyx_v_output_format, __pyx_t_14, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1282, __pyx_L1_error) __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_10 = 1; @@ -17807,14 +17968,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1273, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1273, __pyx_L1_error) + __PYX_ERR(0, 1282, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1272 + /* "pyreadstat/_readstat_parser.pyx":1281 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< @@ -17823,17 +17984,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1274 + /* "pyreadstat/_readstat_parser.pyx":1283 * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": # <<<<<<<<<<<<<< * try: * import pandas */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1275 + /* "pyreadstat/_readstat_parser.pyx":1284 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -17849,20 +18010,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1276 + /* "pyreadstat/_readstat_parser.pyx":1285 * if output_format == "pandas": * try: * import pandas # <<<<<<<<<<<<<< * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") */ - __pyx_t_18 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pandas, 0, 0, __pyx_mstate_global->__pyx_kp_u_pyreadstat_pandas, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1276, __pyx_L24_error) + __pyx_t_18 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pandas, 0, 0, __pyx_mstate_global->__pyx_kp_u_pyreadstat_pandas, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1285, __pyx_L24_error) __pyx_t_7 = __pyx_t_18; __Pyx_GOTREF(__pyx_t_7); __pyx_v_pandas = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1275 + /* "pyreadstat/_readstat_parser.pyx":1284 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -17886,7 +18047,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1277 + /* "pyreadstat/_readstat_parser.pyx":1286 * try: * import pandas * except: # <<<<<<<<<<<<<< @@ -17895,12 +18056,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1277, __pyx_L26_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1286, __pyx_L26_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_3); - /* "pyreadstat/_readstat_parser.pyx":1278 + /* "pyreadstat/_readstat_parser.pyx":1287 * import pandas * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") # <<<<<<<<<<<<<< @@ -17908,7 +18069,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * try: */ __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1278, __pyx_L26_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1287, __pyx_L26_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17927,15 +18088,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1278, __pyx_L26_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1287, __pyx_L26_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 1278, __pyx_L26_except_error) + __PYX_ERR(0, 1287, __pyx_L26_except_error) } - /* "pyreadstat/_readstat_parser.pyx":1275 + /* "pyreadstat/_readstat_parser.pyx":1284 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -17951,7 +18112,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L29_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1274 + /* "pyreadstat/_readstat_parser.pyx":1283 * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -17960,17 +18121,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1279 + /* "pyreadstat/_readstat_parser.pyx":1288 * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": # <<<<<<<<<<<<<< * try: * import polars */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1288, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1280 + /* "pyreadstat/_readstat_parser.pyx":1289 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -17986,20 +18147,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1281 + /* "pyreadstat/_readstat_parser.pyx":1290 * if output_format == "polars": * try: * import polars # <<<<<<<<<<<<<< * except: * raise PyreadstatError("You requested polars as output_format but cannot import polars") */ - __pyx_t_18 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_polars, 0, 0, __pyx_mstate_global->__pyx_kp_u_pyreadstat_polars, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1281, __pyx_L33_error) + __pyx_t_18 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_polars, 0, 0, __pyx_mstate_global->__pyx_kp_u_pyreadstat_polars, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1290, __pyx_L33_error) __pyx_t_3 = __pyx_t_18; __Pyx_GOTREF(__pyx_t_3); __pyx_v_polars = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1280 + /* "pyreadstat/_readstat_parser.pyx":1289 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18023,7 +18184,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1282 + /* "pyreadstat/_readstat_parser.pyx":1291 * try: * import polars * except: # <<<<<<<<<<<<<< @@ -18032,12 +18193,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1282, __pyx_L35_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1291, __pyx_L35_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1283 + /* "pyreadstat/_readstat_parser.pyx":1292 * import polars * except: * raise PyreadstatError("You requested polars as output_format but cannot import polars") # <<<<<<<<<<<<<< @@ -18045,7 +18206,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1283, __pyx_L35_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1292, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18064,15 +18225,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1283, __pyx_L35_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1292, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 1283, __pyx_L35_except_error) + __PYX_ERR(0, 1292, __pyx_L35_except_error) } - /* "pyreadstat/_readstat_parser.pyx":1280 + /* "pyreadstat/_readstat_parser.pyx":1289 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18088,7 +18249,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L38_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1279 + /* "pyreadstat/_readstat_parser.pyx":1288 * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": # <<<<<<<<<<<<<< @@ -18097,7 +18258,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1286 + /* "pyreadstat/_readstat_parser.pyx":1295 * * * if extra_date_formats is not None: # <<<<<<<<<<<<<< @@ -18107,7 +18268,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_date_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1287 + /* "pyreadstat/_readstat_parser.pyx":1296 * * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18117,7 +18278,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1288 + /* "pyreadstat/_readstat_parser.pyx":1297 * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_date_formats.extend([format_regex.match(edf).group(1) for edf in extra_date_formats if format_regex.match(edf)]) # <<<<<<<<<<<<<< @@ -18126,13 +18287,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1288, __pyx_L1_error) + __PYX_ERR(0, 1297, __pyx_L1_error) } - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1288, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_extra_date_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1288, __pyx_L1_error) + __PYX_ERR(0, 1297, __pyx_L1_error) } __pyx_t_9 = __pyx_v_extra_date_formats; __Pyx_INCREF(__pyx_t_9); __pyx_t_19 = 0; @@ -18140,13 +18301,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_19; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_edf, __pyx_t_3); __pyx_t_3 = 0; @@ -18157,10 +18318,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_edf}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { __pyx_t_12 = __pyx_v_10pyreadstat_16_readstat_parser_format_regex; @@ -18170,7 +18331,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_edf}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_8 = __pyx_t_14; @@ -18181,18 +18342,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1288, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1287 + /* "pyreadstat/_readstat_parser.pyx":1296 * * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18202,7 +18363,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1290 + /* "pyreadstat/_readstat_parser.pyx":1299 * sas_date_formats.extend([format_regex.match(edf).group(1) for edf in extra_date_formats if format_regex.match(edf)]) * elif file_format == FILE_FORMAT_SPSS: * spss_date_formats.extend([format_regex.match(edf).group(1) for edf in extra_date_formats if format_regex.match(edf)]) # <<<<<<<<<<<<<< @@ -18211,13 +18372,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1290, __pyx_L1_error) + __PYX_ERR(0, 1299, __pyx_L1_error) } - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_extra_date_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1290, __pyx_L1_error) + __PYX_ERR(0, 1299, __pyx_L1_error) } __pyx_t_9 = __pyx_v_extra_date_formats; __Pyx_INCREF(__pyx_t_9); __pyx_t_19 = 0; @@ -18225,13 +18386,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_19; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_edf, __pyx_t_3); __pyx_t_3 = 0; @@ -18242,10 +18403,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_edf}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { __pyx_t_12 = __pyx_v_10pyreadstat_16_readstat_parser_format_regex; @@ -18255,7 +18416,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_edf}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_14 = __pyx_t_8; @@ -18266,18 +18427,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1290, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1289 + /* "pyreadstat/_readstat_parser.pyx":1298 * if file_format == FILE_FORMAT_SAS: * sas_date_formats.extend([format_regex.match(edf).group(1) for edf in extra_date_formats if format_regex.match(edf)]) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18287,7 +18448,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1292 + /* "pyreadstat/_readstat_parser.pyx":1301 * spss_date_formats.extend([format_regex.match(edf).group(1) for edf in extra_date_formats if format_regex.match(edf)]) * elif file_format == FILE_FORMAT_STATA: * stata_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18296,11 +18457,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1292, __pyx_L1_error) + __PYX_ERR(0, 1301, __pyx_L1_error) } - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1292, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1301, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1291 + /* "pyreadstat/_readstat_parser.pyx":1300 * elif file_format == FILE_FORMAT_SPSS: * spss_date_formats.extend([format_regex.match(edf).group(1) for edf in extra_date_formats if format_regex.match(edf)]) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18310,7 +18471,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1294 + /* "pyreadstat/_readstat_parser.pyx":1303 * stata_date_formats.extend(extra_date_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18318,7 +18479,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if file_format == FILE_FORMAT_SAS: */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18337,16 +18498,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1294, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1294, __pyx_L1_error) + __PYX_ERR(0, 1303, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1286 + /* "pyreadstat/_readstat_parser.pyx":1295 * * * if extra_date_formats is not None: # <<<<<<<<<<<<<< @@ -18355,7 +18516,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1295 + /* "pyreadstat/_readstat_parser.pyx":1304 * else: * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: # <<<<<<<<<<<<<< @@ -18365,7 +18526,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_datetime_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1296 + /* "pyreadstat/_readstat_parser.pyx":1305 * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18375,7 +18536,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1297 + /* "pyreadstat/_readstat_parser.pyx":1306 * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_datetime_formats.extend([format_regex.match(edtf).group(1) for edtf in extra_datetime_formats if format_regex.match(edtf)]) # <<<<<<<<<<<<<< @@ -18384,13 +18545,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1297, __pyx_L1_error) + __PYX_ERR(0, 1306, __pyx_L1_error) } - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_extra_datetime_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1297, __pyx_L1_error) + __PYX_ERR(0, 1306, __pyx_L1_error) } __pyx_t_3 = __pyx_v_extra_datetime_formats; __Pyx_INCREF(__pyx_t_3); __pyx_t_19 = 0; @@ -18398,13 +18559,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_19; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_edtf, __pyx_t_9); __pyx_t_9 = 0; @@ -18415,10 +18576,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_edtf}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_1) { __pyx_t_12 = __pyx_v_10pyreadstat_16_readstat_parser_format_regex; @@ -18428,7 +18589,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_edtf}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_8 = __pyx_t_14; @@ -18439,18 +18600,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1297, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1296 + /* "pyreadstat/_readstat_parser.pyx":1305 * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18460,7 +18621,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1299 + /* "pyreadstat/_readstat_parser.pyx":1308 * sas_datetime_formats.extend([format_regex.match(edtf).group(1) for edtf in extra_datetime_formats if format_regex.match(edtf)]) * elif file_format == FILE_FORMAT_SPSS: * spss_datetime_formats.extend([format_regex.match(edtf).group(1) for edtf in extra_datetime_formats if format_regex.match(edtf)]) # <<<<<<<<<<<<<< @@ -18469,13 +18630,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1299, __pyx_L1_error) + __PYX_ERR(0, 1308, __pyx_L1_error) } - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_extra_datetime_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1299, __pyx_L1_error) + __PYX_ERR(0, 1308, __pyx_L1_error) } __pyx_t_3 = __pyx_v_extra_datetime_formats; __Pyx_INCREF(__pyx_t_3); __pyx_t_19 = 0; @@ -18483,13 +18644,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_19; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_edtf, __pyx_t_9); __pyx_t_9 = 0; @@ -18500,10 +18661,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_edtf}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_1) { __pyx_t_12 = __pyx_v_10pyreadstat_16_readstat_parser_format_regex; @@ -18513,7 +18674,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_edtf}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_14 = __pyx_t_8; @@ -18524,18 +18685,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1299, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1298 + /* "pyreadstat/_readstat_parser.pyx":1307 * if file_format == FILE_FORMAT_SAS: * sas_datetime_formats.extend([format_regex.match(edtf).group(1) for edtf in extra_datetime_formats if format_regex.match(edtf)]) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18545,7 +18706,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1301 + /* "pyreadstat/_readstat_parser.pyx":1310 * spss_datetime_formats.extend([format_regex.match(edtf).group(1) for edtf in extra_datetime_formats if format_regex.match(edtf)]) * elif file_format == FILE_FORMAT_STATA: * stata_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18554,11 +18715,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1301, __pyx_L1_error) + __PYX_ERR(0, 1310, __pyx_L1_error) } - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1301, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1310, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1300 + /* "pyreadstat/_readstat_parser.pyx":1309 * elif file_format == FILE_FORMAT_SPSS: * spss_datetime_formats.extend([format_regex.match(edtf).group(1) for edtf in extra_datetime_formats if format_regex.match(edtf)]) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18568,7 +18729,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1303 + /* "pyreadstat/_readstat_parser.pyx":1312 * stata_datetime_formats.extend(extra_datetime_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18576,7 +18737,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if file_format == FILE_FORMAT_SAS: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1303, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18595,16 +18756,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1303, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1303, __pyx_L1_error) + __PYX_ERR(0, 1312, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1295 + /* "pyreadstat/_readstat_parser.pyx":1304 * else: * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: # <<<<<<<<<<<<<< @@ -18613,7 +18774,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1304 + /* "pyreadstat/_readstat_parser.pyx":1313 * else: * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: # <<<<<<<<<<<<<< @@ -18623,7 +18784,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_time_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1305 + /* "pyreadstat/_readstat_parser.pyx":1314 * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18633,7 +18794,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1306 + /* "pyreadstat/_readstat_parser.pyx":1315 * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_time_formats.extend([format_regex.match(etf).group(1) for etf in extra_time_formats if format_regex.match(etf)]) # <<<<<<<<<<<<<< @@ -18642,13 +18803,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1306, __pyx_L1_error) + __PYX_ERR(0, 1315, __pyx_L1_error) } - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_extra_time_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1306, __pyx_L1_error) + __PYX_ERR(0, 1315, __pyx_L1_error) } __pyx_t_9 = __pyx_v_extra_time_formats; __Pyx_INCREF(__pyx_t_9); __pyx_t_19 = 0; @@ -18656,13 +18817,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1315, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_19; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_etf, __pyx_t_3); __pyx_t_3 = 0; @@ -18673,10 +18834,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_etf}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { __pyx_t_12 = __pyx_v_10pyreadstat_16_readstat_parser_format_regex; @@ -18686,7 +18847,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_etf}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_8 = __pyx_t_14; @@ -18697,18 +18858,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1305 + /* "pyreadstat/_readstat_parser.pyx":1314 * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18718,7 +18879,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1308 + /* "pyreadstat/_readstat_parser.pyx":1317 * sas_time_formats.extend([format_regex.match(etf).group(1) for etf in extra_time_formats if format_regex.match(etf)]) * elif file_format == FILE_FORMAT_SPSS: * spss_time_formats.extend([format_regex.match(etf).group(1) for etf in extra_time_formats if format_regex.match(etf)]) # <<<<<<<<<<<<<< @@ -18727,13 +18888,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1308, __pyx_L1_error) + __PYX_ERR(0, 1317, __pyx_L1_error) } - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_v_extra_time_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 1308, __pyx_L1_error) + __PYX_ERR(0, 1317, __pyx_L1_error) } __pyx_t_9 = __pyx_v_extra_time_formats; __Pyx_INCREF(__pyx_t_9); __pyx_t_19 = 0; @@ -18741,13 +18902,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_9, __pyx_t_19, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_19; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_etf, __pyx_t_3); __pyx_t_3 = 0; @@ -18758,10 +18919,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_etf}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { __pyx_t_12 = __pyx_v_10pyreadstat_16_readstat_parser_format_regex; @@ -18771,7 +18932,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_etf}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_match, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_14 = __pyx_t_8; @@ -18782,18 +18943,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, __pyx_t_7); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1307 + /* "pyreadstat/_readstat_parser.pyx":1316 * if file_format == FILE_FORMAT_SAS: * sas_time_formats.extend([format_regex.match(etf).group(1) for etf in extra_time_formats if format_regex.match(etf)]) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18803,7 +18964,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1310 + /* "pyreadstat/_readstat_parser.pyx":1319 * spss_time_formats.extend([format_regex.match(etf).group(1) for etf in extra_time_formats if format_regex.match(etf)]) * elif file_format == FILE_FORMAT_STATA: * stata_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18812,11 +18973,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1310, __pyx_L1_error) + __PYX_ERR(0, 1319, __pyx_L1_error) } - __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1310, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1319, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1309 + /* "pyreadstat/_readstat_parser.pyx":1318 * elif file_format == FILE_FORMAT_SPSS: * spss_time_formats.extend([format_regex.match(etf).group(1) for etf in extra_time_formats if format_regex.match(etf)]) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18826,7 +18987,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1312 + /* "pyreadstat/_readstat_parser.pyx":1321 * stata_time_formats.extend(extra_time_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18834,7 +18995,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18853,16 +19014,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1312, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1312, __pyx_L1_error) + __PYX_ERR(0, 1321, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1304 + /* "pyreadstat/_readstat_parser.pyx":1313 * else: * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: # <<<<<<<<<<<<<< @@ -18871,16 +19032,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1314 + /* "pyreadstat/_readstat_parser.pyx":1323 * raise PyreadstatError("Unknown file format") * global sas_all_formats, spss_all_formats, stata_all_formats * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats # <<<<<<<<<<<<<< * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats */ - __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1314, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats); @@ -18888,16 +19049,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1315 + /* "pyreadstat/_readstat_parser.pyx":1324 * global sas_all_formats, spss_all_formats, stata_all_formats * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats # <<<<<<<<<<<<<< * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1315, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats); @@ -18905,16 +19066,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1316 + /* "pyreadstat/_readstat_parser.pyx":1325 * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats # <<<<<<<<<<<<<< * * filename = filename_bytes */ - __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats); @@ -18922,7 +19083,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1318 + /* "pyreadstat/_readstat_parser.pyx":1327 * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * * filename = filename_bytes # <<<<<<<<<<<<<< @@ -18931,12 +19092,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 1318, __pyx_L1_error) + __PYX_ERR(0, 1327, __pyx_L1_error) } - __pyx_t_21 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L1_error) __pyx_v_filename = ((char *)__pyx_t_21); - /* "pyreadstat/_readstat_parser.pyx":1320 + /* "pyreadstat/_readstat_parser.pyx":1329 * filename = filename_bytes * * data = data_container() # <<<<<<<<<<<<<< @@ -18949,13 +19110,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); } __pyx_v_data = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1321 + /* "pyreadstat/_readstat_parser.pyx":1330 * * data = data_container() * ctx = data # <<<<<<<<<<<<<< @@ -18964,7 +19125,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":1323 + /* "pyreadstat/_readstat_parser.pyx":1332 * ctx = data * * data.file_format = file_format # <<<<<<<<<<<<<< @@ -18973,7 +19134,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->file_format = __pyx_v_file_format; - /* "pyreadstat/_readstat_parser.pyx":1324 + /* "pyreadstat/_readstat_parser.pyx":1333 * * data.file_format = file_format * data.metaonly = metaonly # <<<<<<<<<<<<<< @@ -18982,7 +19143,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->metaonly = __pyx_v_metaonly; - /* "pyreadstat/_readstat_parser.pyx":1325 + /* "pyreadstat/_readstat_parser.pyx":1334 * data.file_format = file_format * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas # <<<<<<<<<<<<<< @@ -18991,7 +19152,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->dates_as_pandas = __pyx_v_dates_as_pandas; - /* "pyreadstat/_readstat_parser.pyx":1326 + /* "pyreadstat/_readstat_parser.pyx":1335 * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas * data.output_format = output_format # <<<<<<<<<<<<<< @@ -19004,7 +19165,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->output_format); __pyx_v_data->output_format = __pyx_v_output_format; - /* "pyreadstat/_readstat_parser.pyx":1328 + /* "pyreadstat/_readstat_parser.pyx":1337 * data.output_format = output_format * * if encoding: # <<<<<<<<<<<<<< @@ -19015,13 +19176,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_encoding); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1337, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 0); } if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1329 + /* "pyreadstat/_readstat_parser.pyx":1338 * * if encoding: * data.user_encoding = encoding # <<<<<<<<<<<<<< @@ -19034,7 +19195,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->user_encoding); __pyx_v_data->user_encoding = __pyx_v_encoding; - /* "pyreadstat/_readstat_parser.pyx":1328 + /* "pyreadstat/_readstat_parser.pyx":1337 * data.output_format = output_format * * if encoding: # <<<<<<<<<<<<<< @@ -19043,7 +19204,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1331 + /* "pyreadstat/_readstat_parser.pyx":1340 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -19053,7 +19214,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1332 + /* "pyreadstat/_readstat_parser.pyx":1341 * * if file_format == FILE_FORMAT_SAS: * origin = sas_origin # <<<<<<<<<<<<<< @@ -19063,7 +19224,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_sas_origin; - /* "pyreadstat/_readstat_parser.pyx":1333 + /* "pyreadstat/_readstat_parser.pyx":1342 * if file_format == FILE_FORMAT_SAS: * origin = sas_origin * unix_to_origin_secs = sas_secs_from_unix # <<<<<<<<<<<<<< @@ -19073,7 +19234,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1331 + /* "pyreadstat/_readstat_parser.pyx":1340 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -19083,7 +19244,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1335 + /* "pyreadstat/_readstat_parser.pyx":1344 * unix_to_origin_secs = sas_secs_from_unix * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin # <<<<<<<<<<<<<< @@ -19093,7 +19254,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_spss_origin; - /* "pyreadstat/_readstat_parser.pyx":1336 + /* "pyreadstat/_readstat_parser.pyx":1345 * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin * unix_to_origin_secs = spss_secs_from_unix # <<<<<<<<<<<<<< @@ -19103,7 +19264,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1334 + /* "pyreadstat/_readstat_parser.pyx":1343 * origin = sas_origin * unix_to_origin_secs = sas_secs_from_unix * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -19113,7 +19274,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1338 + /* "pyreadstat/_readstat_parser.pyx":1347 * unix_to_origin_secs = spss_secs_from_unix * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin # <<<<<<<<<<<<<< @@ -19123,7 +19284,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_stata_origin; - /* "pyreadstat/_readstat_parser.pyx":1339 + /* "pyreadstat/_readstat_parser.pyx":1348 * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin * unix_to_origin_secs = stata_secs_from_unix # <<<<<<<<<<<<<< @@ -19133,7 +19294,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1337 + /* "pyreadstat/_readstat_parser.pyx":1346 * origin = spss_origin * unix_to_origin_secs = spss_secs_from_unix * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -19143,7 +19304,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1341 + /* "pyreadstat/_readstat_parser.pyx":1350 * unix_to_origin_secs = stata_secs_from_unix * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -19151,7 +19312,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * data.origin = origin */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -19170,16 +19331,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1341, __pyx_L1_error) + __PYX_ERR(0, 1350, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1343 + /* "pyreadstat/_readstat_parser.pyx":1352 * raise PyreadstatError("Unknown file format") * * data.origin = origin # <<<<<<<<<<<<<< @@ -19192,17 +19353,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->origin); __pyx_v_data->origin = __pyx_v_origin; - /* "pyreadstat/_readstat_parser.pyx":1344 + /* "pyreadstat/_readstat_parser.pyx":1353 * * data.origin = origin * data.unix_to_origin_secs = unix_to_origin_secs # <<<<<<<<<<<<<< * * if usecols is not None: */ - __pyx_t_22 = __Pyx_PyFloat_AsDouble(__pyx_v_unix_to_origin_secs); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1344, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyFloat_AsDouble(__pyx_v_unix_to_origin_secs); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1353, __pyx_L1_error) __pyx_v_data->unix_to_origin_secs = __pyx_t_22; - /* "pyreadstat/_readstat_parser.pyx":1346 + /* "pyreadstat/_readstat_parser.pyx":1355 * data.unix_to_origin_secs = unix_to_origin_secs * * if usecols is not None: # <<<<<<<<<<<<<< @@ -19212,7 +19373,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_usecols != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1347 + /* "pyreadstat/_readstat_parser.pyx":1356 * * if usecols is not None: * data.filter_cols = 1 # <<<<<<<<<<<<<< @@ -19221,7 +19382,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->filter_cols = 1; - /* "pyreadstat/_readstat_parser.pyx":1348 + /* "pyreadstat/_readstat_parser.pyx":1357 * if usecols is not None: * data.filter_cols = 1 * data.use_cols = usecols # <<<<<<<<<<<<<< @@ -19234,7 +19395,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->use_cols); __pyx_v_data->use_cols = __pyx_v_usecols; - /* "pyreadstat/_readstat_parser.pyx":1346 + /* "pyreadstat/_readstat_parser.pyx":1355 * data.unix_to_origin_secs = unix_to_origin_secs * * if usecols is not None: # <<<<<<<<<<<<<< @@ -19243,7 +19404,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1350 + /* "pyreadstat/_readstat_parser.pyx":1359 * data.use_cols = usecols * * data.usernan = usernan # <<<<<<<<<<<<<< @@ -19252,7 +19413,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->usernan = __pyx_v_usernan; - /* "pyreadstat/_readstat_parser.pyx":1351 + /* "pyreadstat/_readstat_parser.pyx":1360 * * data.usernan = usernan * data.no_datetime_conversion = no_datetime_conversion # <<<<<<<<<<<<<< @@ -19261,7 +19422,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->no_datetime_conversion = __pyx_v_no_datetime_conversion; - /* "pyreadstat/_readstat_parser.pyx":1354 + /* "pyreadstat/_readstat_parser.pyx":1363 * * # go! * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) # <<<<<<<<<<<<<< @@ -19270,31 +19431,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_t_23.__pyx_n = 1; __pyx_t_23.file_obj = __pyx_v_file_obj; - __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_file_extension, __pyx_v_row_limit, __pyx_v_row_offset, &__pyx_t_23); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_file_extension, __pyx_v_row_limit, __pyx_v_row_offset, &__pyx_t_23); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1363, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1355 + /* "pyreadstat/_readstat_parser.pyx":1364 * # go! * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) # <<<<<<<<<<<<<< * if output_format == 'dict': * data_frame = data_dict */ - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1355, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_data_dict = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1356 + /* "pyreadstat/_readstat_parser.pyx":1365 * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< * data_frame = data_dict * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1357 + /* "pyreadstat/_readstat_parser.pyx":1366 * data_dict = data_container_to_dict(data) * if output_format == 'dict': * data_frame = data_dict # <<<<<<<<<<<<<< @@ -19304,7 +19465,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_data_dict); __pyx_v_data_frame = __pyx_v_data_dict; - /* "pyreadstat/_readstat_parser.pyx":1356 + /* "pyreadstat/_readstat_parser.pyx":1365 * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< @@ -19314,7 +19475,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L70; } - /* "pyreadstat/_readstat_parser.pyx":1359 + /* "pyreadstat/_readstat_parser.pyx":1368 * data_frame = data_dict * else: * data_frame = dict_to_dataframe(data_dict, data) # <<<<<<<<<<<<<< @@ -19322,26 +19483,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ /*else*/ { - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(__pyx_v_data_dict, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(__pyx_v_data_dict, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_data_frame = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L70:; - /* "pyreadstat/_readstat_parser.pyx":1360 + /* "pyreadstat/_readstat_parser.pyx":1369 * else: * data_frame = dict_to_dataframe(data_dict, data) * metadata = data_container_extract_metadata(data) # <<<<<<<<<<<<<< * * return data_frame, metadata */ - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_metadata = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1362 + /* "pyreadstat/_readstat_parser.pyx":1371 * metadata = data_container_extract_metadata(data) * * return data_frame, metadata # <<<<<<<<<<<<<< @@ -19349,19 +19510,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * def parser_entry_point(filename_path, str parser_format=None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_data_frame); __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1362, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1371, __pyx_L1_error); __Pyx_INCREF(__pyx_v_metadata); __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1362, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1371, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1221 + /* "pyreadstat/_readstat_parser.pyx":1230 * * * cdef object run_conversion(object filename_path, py_file_format file_format, py_file_extension file_extension, # <<<<<<<<<<<<<< @@ -19404,7 +19565,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1364 +/* "pyreadstat/_readstat_parser.pyx":1373 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -19466,81 +19627,81 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_parser_format,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_user_missing,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1364, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1373, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 13: values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 12: values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 11: values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 10: values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parser_entry_point", 0) < (0)) __PYX_ERR(0, 1364, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parser_entry_point", 0) < (0)) __PYX_ERR(0, 1373, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_parser.pyx":1365 + /* "pyreadstat/_readstat_parser.pyx":1374 * * def parser_entry_point(filename_path, str parser_format=None, * metadataonly=False, dates_as_pandas_datetime=False, # <<<<<<<<<<<<<< @@ -19550,7 +19711,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1366 + /* "pyreadstat/_readstat_parser.pyx":1375 * def parser_entry_point(filename_path, str parser_format=None, * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< @@ -19563,7 +19724,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1367 + /* "pyreadstat/_readstat_parser.pyx":1376 * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< @@ -19574,7 +19735,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_parser.pyx":1368 + /* "pyreadstat/_readstat_parser.pyx":1377 * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< @@ -19584,78 +19745,78 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, i); __PYX_ERR(0, 1364, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, i); __PYX_ERR(0, 1373, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 13: values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 12: values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 11: values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 10: values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1373, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1364, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1373, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - /* "pyreadstat/_readstat_parser.pyx":1364 + /* "pyreadstat/_readstat_parser.pyx":1373 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -19668,7 +19829,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1366 + /* "pyreadstat/_readstat_parser.pyx":1375 * def parser_entry_point(filename_path, str parser_format=None, * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< @@ -19680,7 +19841,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1367 + /* "pyreadstat/_readstat_parser.pyx":1376 * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< @@ -19690,7 +19851,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_parser.pyx":1368 + /* "pyreadstat/_readstat_parser.pyx":1377 * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< @@ -19711,12 +19872,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_user_missing = values[8]; __pyx_v_disable_datetime_conversion = values[9]; if (values[10]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1367, __pyx_L3_error) + __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) } else { __pyx_v_row_limit = ((int)((int)0)); } if (values[11]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1367, __pyx_L3_error) + __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) } else { __pyx_v_row_offset = ((int)((int)0)); } @@ -19727,7 +19888,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 1364, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 1373, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19738,16 +19899,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser_format), (&PyUnicode_Type), 1, "parser_format", 1))) __PYX_ERR(0, 1364, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 1366, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 1366, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 1367, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 1367, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 1368, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 1368, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser_format), (&PyUnicode_Type), 1, "parser_format", 1))) __PYX_ERR(0, 1373, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 1375, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 1375, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 1376, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 1376, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 1377, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 1377, __pyx_L1_error) __pyx_r = __pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(__pyx_self, __pyx_v_filename_path, __pyx_v_parser_format, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_user_missing, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - /* "pyreadstat/_readstat_parser.pyx":1364 + /* "pyreadstat/_readstat_parser.pyx":1373 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -19795,17 +19956,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parser_entry_point", 0); - /* "pyreadstat/_readstat_parser.pyx":1374 + /* "pyreadstat/_readstat_parser.pyx":1383 * cdef py_file_extension file_extension * * if parser_format == "sav/zsav": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_kp_u_sav_zsav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_kp_u_sav_zsav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1383, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1375 + /* "pyreadstat/_readstat_parser.pyx":1384 * * if parser_format == "sav/zsav": * file_format = FILE_FORMAT_SPSS # <<<<<<<<<<<<<< @@ -19814,7 +19975,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; - /* "pyreadstat/_readstat_parser.pyx":1376 + /* "pyreadstat/_readstat_parser.pyx":1385 * if parser_format == "sav/zsav": * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV # <<<<<<<<<<<<<< @@ -19823,7 +19984,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV; - /* "pyreadstat/_readstat_parser.pyx":1374 + /* "pyreadstat/_readstat_parser.pyx":1383 * cdef py_file_extension file_extension * * if parser_format == "sav/zsav": # <<<<<<<<<<<<<< @@ -19833,17 +19994,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1377 + /* "pyreadstat/_readstat_parser.pyx":1386 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV * elif parser_format == "sas7bdat": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bdat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1377, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bdat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1378 + /* "pyreadstat/_readstat_parser.pyx":1387 * file_extension = FILE_EXT_SAV * elif parser_format == "sas7bdat": * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< @@ -19852,7 +20013,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - /* "pyreadstat/_readstat_parser.pyx":1379 + /* "pyreadstat/_readstat_parser.pyx":1388 * elif parser_format == "sas7bdat": * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT # <<<<<<<<<<<<<< @@ -19861,7 +20022,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT; - /* "pyreadstat/_readstat_parser.pyx":1377 + /* "pyreadstat/_readstat_parser.pyx":1386 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV * elif parser_format == "sas7bdat": # <<<<<<<<<<<<<< @@ -19871,17 +20032,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1380 + /* "pyreadstat/_readstat_parser.pyx":1389 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT * elif parser_format == "xport": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1381 + /* "pyreadstat/_readstat_parser.pyx":1390 * file_extension = FILE_EXT_SAS7BDAT * elif parser_format == "xport": * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< @@ -19890,7 +20051,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - /* "pyreadstat/_readstat_parser.pyx":1382 + /* "pyreadstat/_readstat_parser.pyx":1391 * elif parser_format == "xport": * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT # <<<<<<<<<<<<<< @@ -19899,7 +20060,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT; - /* "pyreadstat/_readstat_parser.pyx":1380 + /* "pyreadstat/_readstat_parser.pyx":1389 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT * elif parser_format == "xport": # <<<<<<<<<<<<<< @@ -19909,17 +20070,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1383 + /* "pyreadstat/_readstat_parser.pyx":1392 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT * elif parser_format == "dta": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1383, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1392, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1384 + /* "pyreadstat/_readstat_parser.pyx":1393 * file_extension = FILE_EXT_XPORT * elif parser_format == "dta": * file_format = FILE_FORMAT_STATA # <<<<<<<<<<<<<< @@ -19928,7 +20089,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA; - /* "pyreadstat/_readstat_parser.pyx":1385 + /* "pyreadstat/_readstat_parser.pyx":1394 * elif parser_format == "dta": * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA # <<<<<<<<<<<<<< @@ -19937,7 +20098,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA; - /* "pyreadstat/_readstat_parser.pyx":1383 + /* "pyreadstat/_readstat_parser.pyx":1392 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT * elif parser_format == "dta": # <<<<<<<<<<<<<< @@ -19947,17 +20108,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1386 + /* "pyreadstat/_readstat_parser.pyx":1395 * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA * elif parser_format == "por": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1395, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1387 + /* "pyreadstat/_readstat_parser.pyx":1396 * file_extension = FILE_EXT_DTA * elif parser_format == "por": * file_format = FILE_FORMAT_SPSS # <<<<<<<<<<<<<< @@ -19966,7 +20127,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; - /* "pyreadstat/_readstat_parser.pyx":1388 + /* "pyreadstat/_readstat_parser.pyx":1397 * elif parser_format == "por": * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR # <<<<<<<<<<<<<< @@ -19975,7 +20136,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR; - /* "pyreadstat/_readstat_parser.pyx":1386 + /* "pyreadstat/_readstat_parser.pyx":1395 * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA * elif parser_format == "por": # <<<<<<<<<<<<<< @@ -19985,17 +20146,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1389 + /* "pyreadstat/_readstat_parser.pyx":1398 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR * elif parser_format == "sas7bcat": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BCAT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bcat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bcat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1398, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1390 + /* "pyreadstat/_readstat_parser.pyx":1399 * file_extension = FILE_EXT_POR * elif parser_format == "sas7bcat": * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< @@ -20004,7 +20165,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - /* "pyreadstat/_readstat_parser.pyx":1391 + /* "pyreadstat/_readstat_parser.pyx":1400 * elif parser_format == "sas7bcat": * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BCAT # <<<<<<<<<<<<<< @@ -20013,7 +20174,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT; - /* "pyreadstat/_readstat_parser.pyx":1389 + /* "pyreadstat/_readstat_parser.pyx":1398 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR * elif parser_format == "sas7bcat": # <<<<<<<<<<<<<< @@ -20023,7 +20184,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1393 + /* "pyreadstat/_readstat_parser.pyx":1402 * file_extension = FILE_EXT_SAS7BCAT * else: * raise PyreadstatError("wrong parser format") # <<<<<<<<<<<<<< @@ -20032,7 +20193,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ /*else*/ { __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -20051,16 +20212,16 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1393, __pyx_L1_error) + __PYX_ERR(0, 1402, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1395 + /* "pyreadstat/_readstat_parser.pyx":1404 * raise PyreadstatError("wrong parser format") * * cdef bint metaonly = 0 # <<<<<<<<<<<<<< @@ -20069,17 +20230,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_metaonly = 0; - /* "pyreadstat/_readstat_parser.pyx":1396 + /* "pyreadstat/_readstat_parser.pyx":1405 * * cdef bint metaonly = 0 * if metadataonly: # <<<<<<<<<<<<<< * metaonly = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1396, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1405, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1397 + /* "pyreadstat/_readstat_parser.pyx":1406 * cdef bint metaonly = 0 * if metadataonly: * metaonly = 1 # <<<<<<<<<<<<<< @@ -20088,7 +20249,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_metaonly = 1; - /* "pyreadstat/_readstat_parser.pyx":1396 + /* "pyreadstat/_readstat_parser.pyx":1405 * * cdef bint metaonly = 0 * if metadataonly: # <<<<<<<<<<<<<< @@ -20097,7 +20258,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1399 + /* "pyreadstat/_readstat_parser.pyx":1408 * metaonly = 1 * * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< @@ -20106,17 +20267,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_dates_as_pandas = 0; - /* "pyreadstat/_readstat_parser.pyx":1400 + /* "pyreadstat/_readstat_parser.pyx":1409 * * cdef bint dates_as_pandas = 0 * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< * dates_as_pandas = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1400, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1409, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1401 + /* "pyreadstat/_readstat_parser.pyx":1410 * cdef bint dates_as_pandas = 0 * if dates_as_pandas_datetime: * dates_as_pandas = 1 # <<<<<<<<<<<<<< @@ -20125,7 +20286,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_dates_as_pandas = 1; - /* "pyreadstat/_readstat_parser.pyx":1400 + /* "pyreadstat/_readstat_parser.pyx":1409 * * cdef bint dates_as_pandas = 0 * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< @@ -20134,7 +20295,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1403 + /* "pyreadstat/_readstat_parser.pyx":1412 * dates_as_pandas = 1 * * cdef bint usernan = 0 # <<<<<<<<<<<<<< @@ -20143,17 +20304,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_usernan = 0; - /* "pyreadstat/_readstat_parser.pyx":1404 + /* "pyreadstat/_readstat_parser.pyx":1413 * * cdef bint usernan = 0 * if user_missing: # <<<<<<<<<<<<<< * usernan = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1404, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1413, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1405 + /* "pyreadstat/_readstat_parser.pyx":1414 * cdef bint usernan = 0 * if user_missing: * usernan = 1 # <<<<<<<<<<<<<< @@ -20162,7 +20323,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_usernan = 1; - /* "pyreadstat/_readstat_parser.pyx":1404 + /* "pyreadstat/_readstat_parser.pyx":1413 * * cdef bint usernan = 0 * if user_missing: # <<<<<<<<<<<<<< @@ -20171,7 +20332,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1407 + /* "pyreadstat/_readstat_parser.pyx":1416 * usernan = 1 * * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< @@ -20180,17 +20341,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_no_datetime_conversion = 0; - /* "pyreadstat/_readstat_parser.pyx":1408 + /* "pyreadstat/_readstat_parser.pyx":1417 * * cdef bint no_datetime_conversion = 0 * if disable_datetime_conversion: # <<<<<<<<<<<<<< * no_datetime_conversion = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1417, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1409 + /* "pyreadstat/_readstat_parser.pyx":1418 * cdef bint no_datetime_conversion = 0 * if disable_datetime_conversion: * no_datetime_conversion = 1 # <<<<<<<<<<<<<< @@ -20199,7 +20360,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_no_datetime_conversion = 1; - /* "pyreadstat/_readstat_parser.pyx":1408 + /* "pyreadstat/_readstat_parser.pyx":1417 * * cdef bint no_datetime_conversion = 0 * if disable_datetime_conversion: # <<<<<<<<<<<<<< @@ -20208,14 +20369,14 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1411 + /* "pyreadstat/_readstat_parser.pyx":1420 * no_datetime_conversion = 1 * * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) */ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; @@ -20223,7 +20384,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1411, __pyx_L1_error) + __PYX_ERR(0, 1420, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -20233,22 +20394,22 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); @@ -20256,7 +20417,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 1411, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 1420, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; @@ -20264,7 +20425,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1411, __pyx_L1_error) + __PYX_ERR(0, 1420, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_data_frame = __pyx_t_4; @@ -20272,26 +20433,26 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __pyx_v_metadata = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1415 + /* "pyreadstat/_readstat_parser.pyx":1424 * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) * * return data_frame, metadata # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data_frame); __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1415, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1424, __pyx_L1_error); __Pyx_INCREF(__pyx_v_metadata); __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1415, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1424, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1364 + /* "pyreadstat/_readstat_parser.pyx":1373 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -20332,6 +20493,7 @@ static PyObject *__pyx_tp_new_10pyreadstat_16_readstat_parser_data_container(PyT p->col_dytpes_isfloat = ((PyObject*)Py_None); Py_INCREF(Py_None); p->col_formats = ((PyObject*)Py_None); Py_INCREF(Py_None); p->col_formats_original = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_informats_original = ((PyObject*)Py_None); Py_INCREF(Py_None); p->origin = Py_None; Py_INCREF(Py_None); p->file_label = ((PyObject*)Py_None); Py_INCREF(Py_None); p->file_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); @@ -20376,6 +20538,7 @@ static void __pyx_tp_dealloc_10pyreadstat_16_readstat_parser_data_container(PyOb Py_CLEAR(p->col_dytpes_isfloat); Py_CLEAR(p->col_formats); Py_CLEAR(p->col_formats_original); + Py_CLEAR(p->col_informats_original); Py_CLEAR(p->origin); Py_CLEAR(p->file_label); Py_CLEAR(p->file_encoding); @@ -20444,6 +20607,9 @@ static int __pyx_tp_traverse_10pyreadstat_16_readstat_parser_data_container(PyOb if (p->col_formats_original) { e = (*v)(p->col_formats_original, a); if (e) return e; } + if (p->col_informats_original) { + e = (*v)(p->col_informats_original, a); if (e) return e; + } if (p->origin) { e = (*v)(p->origin, a); if (e) return e; } @@ -20516,6 +20682,9 @@ static int __pyx_tp_clear_10pyreadstat_16_readstat_parser_data_container(PyObjec tmp = ((PyObject*)p->col_formats_original); p->col_formats_original = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); + tmp = ((PyObject*)p->col_informats_original); + p->col_informats_original = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); tmp = ((PyObject*)p->origin); p->origin = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -20696,7 +20865,6 @@ static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix = Py_None; Py_INCREF(Py_None); __pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix = Py_None; Py_INCREF(Py_None); __pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix = Py_None; Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } @@ -21712,109 +21880,97 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_7) < (0)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":132 + /* "pyreadstat/_readstat_parser.pyx":133 * * * class ReadstatError(Exception): # <<<<<<<<<<<<<< * """ * Just defining a custom exception to raise when readstat gives an error return code. */ - __pyx_t_7 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_7 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_ReadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_ReadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_4 != __pyx_t_7) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 132, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 133, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_4, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_4, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); #endif - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_7) < (0)) __PYX_ERR(0, 132, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_7) < (0)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":139 + /* "pyreadstat/_readstat_parser.pyx":140 * * * class PyreadstatError(Exception): # <<<<<<<<<<<<<< * """ * Just defining a custom exception to raise when pyreadstat raises an exception. */ - __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 140, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_4) < (0)) __PYX_ERR(0, 139, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_4) < (0)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_parser.pyx":855 - * - * - * cdef object _file_object_ctx = None # <<<<<<<<<<<<<< - * - * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: -*/ - __Pyx_INCREF(Py_None); - __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx, Py_None); - __Pyx_GIVEREF(Py_None); - - /* "pyreadstat/_readstat_parser.pyx":1367 + /* "pyreadstat/_readstat_parser.pyx":1376 * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< * list extra_date_formats=None, list extra_time_formats=None): * */ - __pyx_t_6 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "pyreadstat/_readstat_parser.pyx":1364 + /* "pyreadstat/_readstat_parser.pyx":1373 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, */ - __pyx_t_7 = PyTuple_Pack(15, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_6, __pyx_t_2, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_7 = PyTuple_Pack(15, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_6, __pyx_t_2, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_1parser_entry_point, 0, __pyx_mstate_global->__pyx_n_u_parser_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_1parser_entry_point, 0, __pyx_mstate_global->__pyx_n_u_parser_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parser_entry_point, __pyx_t_2) < (0)) __PYX_ERR(0, 1364, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parser_entry_point, __pyx_t_2) < (0)) __PYX_ERR(0, 1373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyreadstat/_readstat_parser.pyx":1 @@ -21867,10 +22023,10 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 80, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 256, __pyx_L1_error) - __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1074, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1093, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1209, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; @@ -21894,25 +22050,25 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "pyreadstat/_readstat_parser.pyx":1096 + /* "pyreadstat/_readstat_parser.pyx":1101 * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "pyreadstat/_readstat_parser.pyx":1251 + /* "pyreadstat/_readstat_parser.pyx":1260 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< * else: * if type(filename_path) == str: */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_surrogateescape); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_surrogateescape); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); #if CYTHON_IMMORTAL_CONSTANTS @@ -21964,31 +22120,31 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 11; } index[] = {{0},{47},{32},{34},{24},{93},{88},{7},{4},{179},{24},{19},{16},{62},{62},{1},{1},{1},{8},{44},{2},{7},{6},{149},{2},{9},{50},{75},{32},{34},{31},{22},{19},{29},{16},{13},{17},{17},{20},{13},{14},{19},{8},{14},{3},{3},{8},{11},{3},{13},{8},{5},{28},{19},{5},{7},{7},{7},{7},{4},{8},{8},{6},{7},{7},{7},{7},{7},{7},{6},{5},{7},{7},{7},{5},{4},{8},{8},{8},{5},{5},{7},{6},{7},{7},{7},{7},{7},{7},{6},{11},{15},{20},{13},{5},{4},{8},{3},{8},{8},{6},{6},{7},{7},{7},{7},{7},{3},{15},{6},{6},{18},{7},{4},{6},{17},{18},{3},{11},{13},{12},{22},{7},{7},{4},{13},{13},{1},{14},{32},{34},{10},{4},{15},{24},{8},{4},{27},{7},{6},{3},{5},{6},{11},{5},{6},{8},{9},{10},{6},{18},{22},{18},{13},{14},{11},{10},{13},{4},{5},{7},{5},{6},{19},{27},{9},{10},{13},{8},{8},{8},{3},{20},{21},{12},{5},{2},{5},{5},{5},{4},{13},{12},{6},{5},{4},{5},{4},{3},{3},{2},{3},{8},{5},{13},{8},{18},{12},{8},{14},{19},{17},{10},{7},{15},{4},{8},{3},{18},{22},{7},{5},{2},{2},{14},{11},{5},{2},{6},{7},{23},{2},{13},{6},{18},{13},{4},{6},{3},{3},{11},{9},{27},{12},{11},{12},{2},{4},{23},{10},{17},{13},{5},{5},{9},{10},{8},{8},{5},{6},{4},{4},{12},{10},{12},{19},{6},{6},{15},{3},{10},{4},{8},{4},{9},{11},{9},{6},{4},{12},{7},{2},{7},{12},{7},{2},{12},{6},{18},{22},{13},{16},{22},{17},{21},{4},{8},{12},{5},{3},{0},{1446},{310},{9},{283}}; - #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2528 bytes) */ -const char* const cstring = "BZh91AY&SY\341\006 6\000\0023\177\377\346\377y\362g\377\375\375\277\373\377\377\377\377\377\377@@@@@@\000@@\000@@@\000@\000`\n/\275w\275\336\307\243\324\367=\222\031\335\334UKgwq\204r\310\355\203\337|4 \223#I\264i\242\236\321\242\217S\324= oB\215\032=@\323@\017Pi\350\200\332\21520!\246\010\014D\002\0235&F\206\250hh\036\240\00044\000\000\r\000\000\0004\000\000\323A\004\2022\020\320\r\351@hh\001\240\000\320\000\000\000\000\000\000\002S\324\224\321\222\236\324\232i\350\215\r\032\r\000\000\000\000\000\000\000\000\001\240\000\005*0\002i\200\004\311\200\000\000\000L\000\000\000\000\000\000\023\032\t\022\0104\021=M5=MS\364\325=\252z\237\225\017D=F\215\007\250\001\241\3524\032\000\000\006\215\000\r\224HbI\265U\304\204\262V\256\226\216D\324=cp\20626\353\000\342\320\0040\r\215h\376o\357'\235\036\201i\316\021 \016\r\037\004\247\274\251\377\177\364\352\272i\347\260\263s\002\235H\251(\217\356HF\230=\230\346A\233\272\320\236\266\024\215*\314\023\022\304(\202\245\314\212\272\201\340\240B\037\262u\037-\222\027\262\312c\004,\013_\237\204\234gq\217\253\355\342u\260\274\327LY\005T\265BNZ\204F\330B\0004W\351l\352\225\250\023\027\236r\223\275\307E+`\016j+X\243\037\304\222\003\243\325\250\326\025\351\324-\037\257\206,\255\366\310\230B\203\241\257)L}\212Tk\216@V\370\261=&(w=\371 \366\335\255hb8\245|\025<\330\005\345\372\207\265(\222L:{\360\r\343\353\373^c\351\336\000y\007\300\247\243\350\356\333%\303C\304\311\030\256\256\204\212\243ST\320\241\234\222\203\024|\331\207S\313\356\357\305\374\016\203+2\346n)\210Jy\206\tG0\033A\215\376\316\336\230!sH\210q\210\372\340\210;\020 \267e<~\347\311\312zs\311\001\005\023\340\024\001\203\016\246K\310\021\021\022\374\310\\\317\267\365\r\274\254\020s\353\347_\250g\237\272]h\014R\272t\224\010YU\334\275\227\003o\273\230\261\330[,\223\317UyZ\352\261\367\023$\\\343;/\273-;\251\222\350\211\261:\221X)\257\266Q \\v\322\275\304\220A.\230h\005\214\020\241\021V\257R\345+c\266'$\023@\332~\202\236W\373\235\225pu'\006\354\033\260\241\002\215\233L2Zl\006\002\263e\031F""\233\320\232\210\251\022\224\302*\rk\223\216\322\257\366\253P\220\0009RB\365l\24415SlpV%\201t\030\006\363ie\340\331\203\013\220DY\324D\235(a\236\375\205\021\220\021\0043\315I]\213o\327\341J\340\276\305\023\350P%\267\\\222\010\304s-\\hRI\325\352\264\326\245\272\026sc\215Xm<\225e\341|\207\001W\"p\300.5\350\230\024m\240\034*\320;\254j\312\363\017\300\212\335k\256\010\"\355\024\324\016\036vS \203=\023c\355\026\307\273\332g\230\354;\260\024;\374\224\306\307\242\001e\202d\010I\016c\211\014\231>\350@\200X\230\211\007W\234]\177\331G\301\020Lhr\322I\264\331\233M\316\326,\311\365\263<\340~x\361T\207\203&\305\020\323\020\016\363|\032\346\250`q\243\n\022i\252\030\022\211\3408$\033!\357g4G@\342P\240m\2106\210$\210\321v\026\231B\347\352\334a|\336\302\027\3000I\177)\207ggW^\005\307\026\3569\270\3017\272\272\352\001\274\254\202\023B\t\224t[[e\335\001\177n\006\371ZV\267\256<\201\r1\315H\014q8\014\340\301D\0045\230\002\262\020\257\247w\3172\274\372\320\341o.(\245d!\2300k\013\222U\231\201(U\203\245\344\017\266\207\"\206\300\264\302j\036\343v\316\231\210\243\001\251X8-\352\254\3235\\\213\226\0206\370t\352\247\321\034\334\361""\275Z\270\220\364\224\243\n\270\334R\025`*nB\226\341=\037q \034\210\270\202\n\261\0225\020\340>\274w\271\304Q\202\312\234Bi\365\3078\314,\2078\210\357S!\2114`\333\332r\013g\207\036\014\251\251\004\242P;\307B\221\2060\334D4D!Bl},\261\342\212$\322%l\257\343L\302\261a\244\256\224 U\t\245\306Y ss\204$\264y\2478S\272\204\304:\021V*9\027\255\241z\355\334\213\305s\211H#\000\324\227\246\312(\230\300\315\342\033J\253`RA\004\022\034l\332XhfV\002)\307&\017\253\"\005\266#D\2564S\265\036H\231\275^\371\022\253<\335\332H'\246)\026\316\023h`\312\326R\254\267\\\243l\344\341\356}\027\357_J\362\025\310\240s\220\300\240\374\224\235\306A@\032\271p\322\354\362\302C\032\3136\3319\364\361^\261\261\236\343\231\036\236y\245\315\324]\031\320~\371\243V\367G\030\346\221&p\273\212\304\032\344I\036?u\251\255\331\326g\"\025\206\2475O\235\035z\261&*D \320\365\020\034\022\263\347ki.U0\246j\240\241%0\310\203\254!Py\227\310\001\250DNh;@\031\374\242\301(s\325?\351*m\201\253\257\271\273\371\375\357c\023\260\002\353HA\336O\370BT \360Q]\024=}~\362\362\\\tD\304DrAY\304}Hq\254404\003\3201_\233\376\312<\222A\313A\236\021\203\240\316\3363\375N\204\246\323V_\370\273\222)\302\204\207\0101\001\260"; - PyObject *data = __Pyx_DecompressString(cstring, 2528, 2); + const struct { const unsigned int length: 11; } index[] = {{0},{47},{32},{34},{24},{93},{88},{7},{4},{179},{24},{19},{16},{62},{62},{1},{1},{1},{8},{44},{2},{7},{6},{149},{2},{9},{50},{75},{32},{34},{31},{22},{19},{29},{16},{13},{17},{17},{20},{13},{14},{19},{8},{14},{3},{3},{8},{11},{3},{13},{8},{5},{28},{19},{5},{7},{7},{7},{7},{4},{8},{8},{6},{7},{7},{7},{7},{7},{7},{6},{5},{7},{7},{7},{5},{4},{8},{8},{8},{5},{5},{7},{6},{7},{7},{7},{7},{7},{7},{6},{11},{15},{20},{13},{5},{4},{8},{3},{8},{8},{6},{6},{7},{7},{7},{7},{7},{3},{15},{6},{6},{18},{7},{4},{6},{17},{18},{3},{11},{13},{12},{22},{7},{7},{4},{13},{13},{1},{14},{32},{34},{10},{4},{15},{24},{8},{4},{27},{7},{6},{3},{5},{6},{11},{5},{6},{8},{9},{10},{6},{18},{22},{18},{13},{14},{11},{10},{13},{4},{5},{7},{5},{6},{19},{27},{9},{10},{13},{8},{8},{8},{3},{20},{21},{12},{5},{2},{5},{5},{5},{4},{13},{12},{6},{5},{4},{5},{4},{3},{3},{2},{3},{8},{5},{13},{8},{18},{12},{8},{14},{19},{17},{10},{7},{15},{4},{8},{3},{18},{22},{7},{5},{2},{2},{14},{11},{5},{2},{6},{7},{27},{23},{2},{13},{6},{18},{13},{4},{6},{3},{3},{11},{9},{27},{12},{11},{12},{2},{4},{23},{10},{17},{13},{5},{5},{9},{10},{8},{8},{5},{6},{4},{4},{12},{10},{12},{19},{6},{6},{15},{3},{10},{4},{8},{4},{9},{11},{9},{6},{4},{12},{7},{2},{7},{12},{7},{2},{12},{6},{18},{22},{13},{16},{22},{17},{21},{4},{8},{12},{5},{3},{0},{1446},{310},{9},{283}}; + #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2534 bytes) */ +const char* const cstring = "BZh91AY&SYC\376N\221\000\0023\177\377\346\377y\362g\377\375\375\277\373\377\377\377\377\377\377@@@@@@\000@@\000@@@\000@\000`\n[\357^\357w\261\350<\367^\212j\347w\025j\326\013\002\332\353A\333*\363\341\222j\t\224\332M\243DOjf\223\322\2326P\323bFL\236\240i\240\007\250\r4\006@\311\20120OA\210\223& j\230&\246H\r<\243\324\320\000\000\003@\001\240\000\000\006\200\000\032h \211\251=542\r\032h\000\031\000\000\000\0004\320\000\321\240\0004h\004\232\222\232iS\360S\311\241Oi'\2224d\032\001\240\332F\200\032\014\200\323@\000\006\2314\323L\232d8\000\000\000\000\000\000\003!\240\000\000\000\000\000\000\000\004\210\202\001\021\212\237\250\247\206\223\325?T\006\230j4dmA\240\r\000\000\014@4h\304\014\3221\310\307\267\025\264U\035\033\325\337\314\364/\234\347\231\240\315C,\360&\352\002\220\014JC\363\241\370_\032=\361m\304\"@94y\305~-\217w\377R\313\271_\036b\325\320\n\367\221bd\355\353\t\304\017\333h\333:\236n\341\372\261I\276\265\n\224\310\242\n\2306\354\354\007~\241\010~\301\336>\203$^\303+\224\020\2613\303_$\244ks/C\336\310\353\341i.\240\242\nie\010\271k\310\272\225\204\000k\227\351L\346\225/\t\213\3138\305\336\327E+`\016j+X\243\035\t$\007G\253Q\254+\331\250Z?w\004Y\\&\322\314\"{\301\307\325[\201\265X\332\216\26069/\277Z\374[\277\035h}\326jW\027\322\235\270\001\245\233\010\270\327\236{3\022\223\016\347\300\200o/\273\354\372\207\330\300\000\360\217\221_\177\352\357\341\242\345\261\330\3114<{\024*\215\315\325b\306J,2\317\341\306>\017\277\245\364\314y^\357{\215\203\251\240\316[L\264\005R`G\002\016\036\316\346\240##\336H\345\021\366\001!\352`\206\236\266\232\177\010\013\264\265'\026\002\024\300\001\2046/j\353\\`c\030\306]\231\023\2726>\341\313\213\231\017K\033>\356\"&\216\361\316\205\005\033)EA\022-\233[N\207.\275\226\320\320i\271\013\357\342\276\272\353W`L\254\324\324I z:w2%\321\022brEUI}\261\270\201a\332\306\326\021A\004\272\201\240\026\020a\210S\251\215\211\221F\300\355\211\254\207\010\r\270'\253\353\203'\017 u\246\2076Q\350\230A\215\275\266\320\264\315\220\3302H\306\350R~$Rh\225V""\311\236\343\216\315J\353w\265R}`\000\226\264O\324\303b\014%\302\253\305P\264\005\220\200#\356Q\265\231\265\r\347a\246s\350\n\331QE:\n\252P\201L1\022\321rkr\316{rc\320\316T'}\0102\315i\021\002\013\t\217+0\333b\"%y#\224\313\245&lq\255\352\357\263\026\337\034\004q\034b]@\017+^\324\002\205\206\001\306\272Ie\267\0327\033O\003\025\273\227\234\020E\352)\250\034\215\326\231\220A\236\235\257\356V\307\275\232\3171\230\356\300P\3611\023I~\210\005\226\t\220!$:N$1$\373\341\002\001bb$\035^qy\364J>(\202\203C\235\2456\2335i\272g\231\233(u3]`~8\354\261\016l\233\004CH@;\311\352\3263B\247\013\330^I\277(T\224I\337\200\375u\371\251\025E\2066\264\313%\245`\242U\307B\304M\357[\315t\222\036\215P\335{l\352\2728\260w\277\355\306\261\t\211X\267\201\277C\231\2052f\263V\273\203\376&s\201}\230\004('\345\233\245\004\2541]|\003\313\333\356~\273\036I\247\250\221\235\004\332\321\272\360]\"\204:\327S\346\3117(q\272/\270\311%\324\267\024\0203\023\267MC\022^\014\210\2068\343\306\014q\026\223R\246\214\325\266\r\013\301\020)\000\272,\004Ue5\0040\257\017E\r\244\227aq\302\354p\334T\002\227\201Q\366\032\232\370\205\352\370\376\226\226\377\275\261\362\016\2604]\356\013\355 \035.1\003adoT\340\362\240\373\\2 ~\016y\2433>\305h\362\214\327\310\323\030\341\227\026\254\0143\034\201\243Tc{\021\321\347vWEb\005\341 \013\273A\304\3414\000\351\007\006\214 U.\022\224\343X3a\321\370\210\201\207'D\252c3\261j\022\271\322B\346\002Y\246\004,\332\324\225\337\306\263z\023\305\006W6\"\361At,AA)\335\024A5\2046\271D\001\036\370U\t\024U\224\261p`\265\233#\014FF\025\035\360\326\2715W\024\222Q\224k\345Y0\234\315\263#\003(b 0dR\026b\332\205\025e\366\304\2431\246\006Xe!\257\024\003\334d\002i\234\345\266\232\353\206~\024\004\030\020E\014\272g\nX\370DY\261\272\232U\032\n\302\371\014\230:+\243\235\302P\327$\2243\21629\230H\206\201b\261\305\260`\233\244\020\253\204V\212*\241\226\355\315\014)N\026\255\300\231\275\352ceR)\262eW2\371OjG[\246Q\240o\033\246A.\203\200\304\334\3504c\257d\230md\032$\311p\210y\031\032\264\210`\242\014,\223\002c\032\355\255\370M\333\351\233\233\371\362Ff8Z\214z\276<\232\260\027\026u\241'\225\007 Z\355\360c\226\352\276M\267v5\003n\351\215H\234\023!\004\006\241S=\217\236\362u\"\024,e>RdD\250\204\321\001\205\302\256\317\207\"\t\013\223\024\220\024\346h\336\005\203\231\220^\230\007\276I\010*\334\254\306Z\270\301 L\336x\2046h\016hi\263\2445\232h\224\004\330e`\375\364\006\203\217\000\375=\222\274Ll\267C\212\002\344Db\300\007\024\203\303\"6\"8W;\215\331\345\001}'A\267\031V\203\0349\335\nH\207\251R\314\213\211eH8\302TW\365\2328\016\227L\221\032\003\314\311\223\331\340\265\347\007H5X5A\322\233\025[cV\251B\244\rUE\241\033.\263:\025.\375\013\230\341G\300B\363LR_\332\201\327\327\336\352\304\271\315\273\235<\340Ai\034\363 \013\010\271\014P$\010\013\225\307Uu\036V\002\376I\213=^\265\364\307\240!\246:+\006\362\365&\203\253Hd\345\320D\246E;\264\247\242\355s\354C\205\271rb\225\220\206`\301\254.IVf\004\241V\016\227 }\34490y\021\207K\304\246s\360\351]DU\200\324\346\034\227B\2636\325[B\353\030\022[8\2630\333{\360kk*\323\002\036q\215\320\243\216\022\220\233\0013b\024xD\264\236\322@""\265F\305\030\361\251e\211N\013\360\327\273+C\010\036\270s.\347\246\273\253q\352x\021^\353\272!#f\r\276\024\220\317\\y\362e\215\304\023\023\003\300u+\030\345\r\304CDB\024&\307\334fgdU&\2219\351\207:\352\026\214\306\222\274\302\005`\242\\\347D\016\216\220\204\226\317T\351\n\227\251A\016\244Y\212\256L\033\324/ky\0270\215\245\013A\325\227\214e\261\235 \325\344s\027b`\252\")\256\253F3D\2769\013\233\033\271-\2374\0055\243zV\032)R\365\201\020\0267\255\341\342\207\241\313\223\201\014\250H\256,R\t\203-i\233N\373\250\341\254\270{\337\221\207B\372\330\020\256\212\207\022\030\025\037\206\264\271\240T\006\256\271m}t\306F5\246\255\262\224\356s_\\\340k\274\351G\227\256$\360s\304\233\033\202\346Df\226\21477\003\207Cd\267\032\000\216\360\344v}~c9kj\035\262\026cT\242\257\247\035[\230\223\025b\020ly\350\016If\370\265\302N\370\211\335\211\210\005\2117\242D\356#p\364\241\274\010\261&^d\364\t|[{\276\340K\325;\355m\233\200~5\367w\277\234\037\335<\034 \346\354\021\305\341\343&y\034\223\262o\325\377\177\344\337\345\240%\301\254\373\270\353\372\301\241\351v\226\257\243\353lg\214\256\235\254\024\223\276\210\023\234Fp*\032#+\256\255p&\223\216\253\254V\177\027rE8P\220C\376N\221"; + PyObject *data = __Pyx_DecompressString(cstring, 2534, 2); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2288 bytes) */ -const char* const cstring = "x\332\255XQo\033\271\021V\000\027M\357\232\242i\201^[\240\000\003\\*;\261\025;\r\322$\r.p,\247q\n9N\344^\353\336\245\237{ T$C\026\350xO\246\226\2550\253Y\222\333\201\216\331\236\2102Y\314\203\233J\021\2628\033n\313\224\351\036fS%\266#i\036`\001{\276\370\222\205Z\032\026k\313\344\2012\366\322'\014\177\2172cY({*Vq\237\t\026`\254\207X\021\310\304*\034B\202\2052\222\355\017d\354\3160VX\326W{\020&b&\323T\247\340\333,\215\241e([N\356\207\010O\362J\274\343z\371\345b/\367n\347\326W\261y\266\256c\271\256\255dv\200\325+\336\036\312\340\260H\341\376\302\312(g\306\246*\260\260\006\026\305lcuc\341\306\255\033\220\031B\335\177\311\300\032f\262\355 \022\206\216\202\305\2663\025Y\005\255\362D\232\026[\353\261\\g,\226\336\274\t\326\3257XR\331HK\035\326\0241\014+HO\216\355\270n\223\205*\305!\260\023\355~ \"#[\335\315\247k\353\177v\007\260}e\007\336\205\254\371\327x'\326\3731\353\221\253z:\035\n\013\026qBa\205[\277\005UR\271\233Ic\241O\202[\010\330\007zg6\311,\367\233p\005\313\002\247\013S\303D\0030~\345\324n\035\211\364\377\333\355V6[\367D\030r\360e\240\243l\030\263&\360\324t\006\317\222H\005\260w8\217\003b1\364\306j>_z\331\274\034\206\312\020\004\301G\353.\227\010\334:\320Y\024:$nK&cBM\350\355q\331\000\n*\030\220h\262-T\204\017Rfr(>\364ka\334yf\323\2340\205\243\374~\246\334\342\314\366\026n\265\330F$\005PE\022\316\332\016\005R\362M\224\267\372\001\200\346\324\013cMX\025Yd\031\347\251\014\263@r\216\013:\377\305:^\000\234\366\224\2100\033\000\321\226so\275\302alHh\307\205\000MB\323s\021Ez_\206\205q\315\313yXe\302\336\260\340>t\246P\212\235]J\t\022\246\000l\201_\206\330\332\316\2554\023\363\230\230\367l\232\317bE\026\030G\3175^\366x\002\357\311\264\225\344\007\343\351\026|\030\0212ulj\\ MZ5\254\311i\305\"\335\037\000\270-""\214`\241\326\336\365\372d6L\362\332X\327\205y\324\325\031\016HuF^\004R\215\227\326\017\207\317j\243}\221R\0221F\354]\373\026\315]\nn\214\341\335@~q\331\256\\\266\001>\017\037\336\351tJz\247\333\275lC|VV\266\266\026\326\327\027\332m\014\332|\310\267\034N\232\036stq\037\222\2122\230\307\367~\252\201\023o\276\302\301\313\355\345\315\325\373\267n..\265\227=Y\367d\323\221\315\016\315\323w\271\263\341\372\233k\235\325v\273\323\331\332\362\355}OVJ\236#\353\236lx\322mo:)\264u\325\037\345\311\346\252?\303\035\360\360a\247\263\326\365\323\005\335\364t\263\263\026\333\2337\036\321\252N{\2134\351t\332\355\255-\337\336\367d\305\223\266'\353\236lx\322}\274M\271\361q\032J\304@\033\tt\243\362\302*\345z\3167\362\003|i\212\257\313\003\373T\366\236\326\027t\313\273\323\2274\330|\334\376\333\352\352_\210]\320\277ou\332\017;\335R-j\357{R\214\326=\331\360\244\213P\232\212&\221$\222 F~\023&\217\003\245\201\353\024\361\245bi\266E\260\203\351\000\363\201\214Q\002\020\262\2046\336\007\304\221\th\210u\\![\247\"\220\264\036\236\257\005\206\307\001\217\304\266\214\312\001e\267\211>\267zb\005\3100A\226\0134\320\2553\034\034r\227\341\003X\320\327\006\004XH9\235\243\240[\001\035\322\311Q\253J=\201+j\234\237\232GV#[O\255\350\245\224{)\021\343k\2700\334\307\340\324\220\227a^Q\270\261H\323\325\034\367\257\r\243\234t\035P\223Q\212\264\"$\203\273\006\242\252\334/\207\211\315}\".s\254D~p\205X\036\320\311\031\342\010X\201S\320\246\302\035U\372r\314q\207Op\353\034* \274\224\357\007$\221\324t#\277\314u\235W\250G~\342\224<1\210z\221\306<57o\200\350\264\330\341\305\223\221\3506}\235\3465\226\366\2210\236J\365\220\223\325\\G&:\030P\217\024\205[\206I\317\204\222\014\3213\336 \234\367\262\030&\004\364\360\001p\350I\340\361\223\000z\340\221\236\276B\225\227s\253\275\223y\037\240N\006J\305v\351&\232?\\W\024\341hnq\005\205K\314\243\017\245\006\032\017\254\\9S\021\320\315\216\314\2153\006\352\257\2059\"e#\035\221K\207\300\023\2656\030\200H+|\204\270.!\252\244c\354\225\034\035G9\365\035U\306\220\302\251\200\313M9""\"o{\344\233!.\324#\224\224\360\307\t:\314\"\242\251\3032u4\374\212\204\016P9\313\214\333\370t\r\212\365Y@\215\365P\305\"\2427\212\211\223\330\372\2070/\002\263\030\245z\337\270\272\025\357k\227\346\340\\\332\245S\325'\312\313G3w\010\327f\242^\027E\315\325\004\247o\316\023\rG\024\234r\221\035\024\305N'\t\245\313\004eM\244\270\315Y%o\272T\323\252\003`-Q\234\373~\001\203\335\014\227sFI%\355\251\366M\252<~\271\234J$\025C\036\240\253\372\003\013\350\304!l\302#5T\226:\272\327#\227\010\363\307\355@x\n[\233@\000\241\301@\016\361\252\222;\006\241\345\322P\341%\364\212\207S-9\3613\022\225waQ\2713\324\212>\345\007HO\034\376\335-H$^\357\021\347p$\004\222\233\235\253\361\314\261v\354zt}(Y\035\341\327\014]\036\227\301\326\0248\300=\375\213:3\200\"0`\034\"\013xR\037\310\332\273\356\020Zdp\217\326\312\230\"R\375\030\361h+\016\222d\022\211\234\357\253\320\016*.\235]\r\206(EY*\2531~\355\244\242/\247\266\224E\243b\324\325\240wN\371\326\241\327I\t\340\003z\216\177\253\222\215\334\327gvev\334\235g\036*\226/-\216\261\305\227n\236BW\222\363Z\252|\377}U\302\235g\365\343\021\004Es67\322\364f\367m}\305\273\373s\215\357\2711P\224\005\266\270\000\202\371\235W\230\314eS\222\337\303\016Suj\236\371\332\370\341>8e\262:\303\013\237\320\365#\334\274\361\341\367e\037\001ws\r\334\223\315\006\003\221\222\220Z*\243@\200\005\312\231=\255B\322\327-w\266\371\376\2313\022\"-|\357\r\247\265\231\330ZMW\365\321\326\305;Z\335\354\007\273\352\007Eh=\352&5I,\027i\337\274Sh\232\305\323;4G\227>.\343\344\374\317^\353\243'G\342d\206\246g~\374j\367\370\374/\017\227Nf\330\233s\305\360\267G\227Nf~}T\016\177q\210a\363\315n1\274\364\346\342\311\314\317\017?=\372\342\355\305\267\327\276\373\335\350\301\227\243/\277\031}#\216\257\374\351\273\333\377Y\033u\344H\342f{\243\275\027\243\027/\217\257\334\036\335~2z\002f\357d\346\323\327w\017w\377\007N\360l\256"; - PyObject *data = __Pyx_DecompressString(cstring, 2288, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2293 bytes) */ +const char* const cstring = "x\332\255X_o\024\311\021_$G!w!\n\211\224K\"Ej\244#k\203\275\330\004\021 \350\220\361\232`\2425\206u.q\356H_{\246w\267\343\331\351\361t\217\3559 \342\221G?\372\221G>\302=\346#\354\243\037\375\021\362\021\362\253\356\231\331\331\265O\004\016dOuWwW\327\237_U\265\371\347\354W\313\013\377xF\237\305\205\333\317\256\272\331\334\354\327\341\325\271{\263\367f\257\317\315\336\273\363u\313M?\177\361\371\334\003\241\"\031\262@\307{2\265l\205Y\315\222\334\016t\314\366D\224\311b\035\334T\212\220\305\331p[\246L\367\260\232*\261\035I\363\000\033\330\363\305\227,\324\322\260X[&\017\224\261\227>a\370\367(3\226\205\262\247b\025\367\231`\001\346z\210\035\201L\254\302%$X(#\331\376@\306\356\016c\205e}\265\007a\"f2Mu\n\276\315\322\030Z\206\262\345\344~\210\360$\257\304;\256\227_n\366r\357vn}\025\233g\353:\226\353\332Jf\007\330\275\342\375\241\014.\213\024\354\027VF936U\201\2057\260)f\033\253\033\0137n\335\200\314\020\352\376K\006\3260\223m\007\2210t\025<\266\235\251\310*h\225'\322\264\330Z\217\345:c\261\364\356M\260\257~\300\222\312FZ\032\260\246\210\341XAzr\034\207\271M\026\252\024\227\300Ot\372\201\210\214lu7\237\256\255\377\331]\300\366\225\035\370\020\262\346_\343\235X\357\307\254G\241\352\351t(,X\304\t\205\025n\377\026TI\345n&\215\205>\t\254\020\360\017\364\316l\222Y\356\017\301\004\313\002\247\013S\303D\0030~\347\324i\035\211\364\377;\355v6[\367D\030r\360e\240\243l\030\263&\360\324t\016\317\222H\005\360w8\217\013b1\364\316j>_z\331\274\034\206\312\020\004\301\307\327\031\227\010X\035\350,\n\035\022\267%\2231\241&\364\376\270l\000\005\025\014H4\371\026*\"\006)39\024\037\372\275p\356<\263iN\230\302U\376\200\007}o@\202\205T\3239\032\272\025\320!\235\234\265\252\322\023\270\246\306\371\251uT5\362\365\324\216^J\265\227\n1~\r\027\206\373\034\234\232\3622\315+\2120\026e\272Z\343\376\265a\224\223\256\003\372dT\"\255\010\311\341\356\003QU\355\227\303\304\346\276\020\2275V\242>\270F,\017\350\346\014y\004\254 (\370\246\302]U\306r\314q\227Op\353\034j \274\224\357'$\221\324t3\277\315\r]ThDq\342T<1\211z\221\306:}n\336\000\321iq\302\213''\2215}\235\3465\226\366\2310^J\365\220\223\327\334@&:\030\320\210\024EX\206I\317\204\222\034\3213\336!\234\367\262\030.\004\364\360\003\340\320\223\300\343'\001\364\300#=}\207*\215s\273}\220y\037\240N\006J\305v\351&>\177\270\256(\303\361\271\305\025\024.1\2171\224\032h<\260r\345\\E@7;27\316\031\350\277\026\356\210\224\215tD!\035\002O\364\265\301\000DZ\3413\304\r\tQ%\035c\257\344""\3508\312i\354\2502\206\024N\005Bn\312\031E\333#\337\014aP\217PR\302\0377\3500\213\210\246\016\3134\320\210+\n:@\345<3\376\306\247{P\254\317\002j\254\207*\026\021\275QL\234\304\326?\204y\221\230\305,\325\373\306\365\255x_\2732\207\340\322)\235\252>Q^>\232Q\031\n\010\234^r\340\327f\242\225\027\375\316\265\013gJ\316\023\215\030\025\234r\223\035\024}P'\tU\322\004\035O\2440\364\254n8\335\305i\327\001`\230(\316\375\270@\310n\006\273\235\277RIg\252s\223*\217\0375\247jL\305\220\007\030\252\376\300\002Uq\010w\361H\r\225\245\201\356\365(Z\302\374q;\020\236\"\014&\020\000o0\220C<\270\344\216A\326\271\nU\004\020\243\342MU\253[\374\214\032\346\243[4\365\014m\244O\245\003\322\023\227\032\316\n\022\211\207}\3049b\014\201\204\000\207\002\274\200\254\035\243\002C\237eVG\370C\207\214\20718\232\002\"\260\323?\2663\003\224\002\036\306\201\265@.\215\001\272\275\353\016\274Eq\367@\256\234)\"\325\217\221\252\266\342\240~&\221\310\371\276\n\355\240\342\322\335\325d\210.\225\245\262\232\343\017\241T\364\345\324\221\262\237T\214\272\032\364\004*\237A\364p)\261}@/\365oU\262\221\373\326\315\256\314\216\207\363\314C\305\362\245\3051\266\370\322\315S\350Jr^\253\242\357\177\256\252\305\363\254~=\222\240\370\234\315\2154=\347\375\267\276\343\335\343\271\306\367X\014\024e\201-\014@\236\277\323\204\31127%\371=\3740\325\302\346\231o\233\037\036\203S.\2533\274\360\t]?\202\345\215\017\267\227}\004\334\3155`'\233\r\006\"%!\265RF\211\000\017\224+{Z\205\244\257\333\356|\363\375+g\024D\332\370\336\007Nk3q\264Z\256Z\247\255\213w\264\262\354\007\207\352\007eh=\353&5I,\027i\337\274Sh\232\305\323\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\340\004\013\210<\220q"; + #else /* compression: none (5721 bytes) */ +const char* const bytes = "^([A-Z][A-Z0-9]+[A-Z])(\\d+)?(?(2)(?:\\.\\d+)?$|$)Failed convert C to python valueFailed to read number of variablesFile {0} does not exist!\n Just defining a custom exception to raise when readstat gives an error return code.\n \n Just defining a custom exception to raise when pyreadstat raises an exception.\n %tC%tc%tcHH:MM%tcHH:MM:SS%td%tdCCYY-NN-DD%tdD_m_Yutf-8' with date type in column 'wrong parser formatADATEB8601DAB8601DNB8601DTB8601TMDATEDATEAMPMDATETIMEDDMMYYDDMMYYBDDMMYYCDDMMYYDDDMMYYNDDMMYYPDDMMYYSDTDATEDTIMEE8601DAE8601DTE8601TMEDATEHHMMIS8601DAIS8601DTIS8601TMInt64JDATEMDYAMPMMMDDYYMMDDYYBMMDDYYCMMDDYYDMMDDYYNMMDDYYPMMDDYYSObjectOrderedDictPyreadstatError__Pyx_PyDict_NextRefReadstatErrorSDATETIMETIMEAMPMTODWEEKDATEWEEKDATXYMDHMSYYMMDDYYMMDDBYYMMDDDYYMMDDNYYMMDDPYYMMDDSallallowed_formatsappendastypeasyncio.coroutinesbackendcastcenter__class_getitem__cline_in_tracebackcolcollectionscolumn_labelscolumn_namescolumn_nam""es_to_labelscolumnscompilecopycounted_valuecreation_timeddata_containerdata_container.__reduce_cython__data_container.__setstate_cython__data_framedatedates_as_pandasdates_as_pandas_datetimedatetimedictdisable_datetime_conversion__doc__doubledtadtypedtypes_duplicatedemptyencodeencodingenumerateexpanduserextendextra_date_formatsextra_datetime_formatsextra_time_formatsfile_encodingfile_extensionfile_formatfile_labelfilename_pathfillfloatfloat64floorformatformats_as_categoryformats_as_ordered_categoryfrom_dictfrom_epochfromtimestampfsdecodefsencode__func__getget_native_namespacegetfilesystemencoding__getstate__grouphiint16int32int64int8_is_coroutineis_dichotomyisfileitemskeyslabelleftlenlitloloc__main__match__metaclass__metadatametadata_containermetadataonlymetaonlymissing_rangesmissing_user_valuesmodification_time__module__mr_sets__mro_entries__name__name__nannarwhals.stable.v2no_datetime_conversionnominalnotesnpntnumber_columnsnumber_rowsnumpynwobjectordinaloriginal_variable_informatsoriginal_variable_typesosoutput_formatpandasparser_entry_pointparser_formatpathpolarspoppor__prepare__pyclassespyreadstat._readstat_parser__pyx_capi____pyx_state__qualname__rereadreadstat_variable_types__reduce____reduce_cython____reduce_ex__rightroundrow_limitrow_offsetsas7bcatsas7bdatscaleschemaseekself__set_name__setdefault__setstate____setstate_cython__stablestringsurrogateescapesystable_nametell__test__timetime_unitto_datetimeto_nativetolisttypeundeterminedunknownususecolsuser_missingusernanv2value_labelsvaluesvariable_alignmentvariable_display_widthvariable_listvariable_measurevariable_storage_widthvariable_to_labelvariable_value_labelswarnwarningswith_columnsxportzipPyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension, PyObject *, int, int, PyObject *, int, int, long, long, PyObject *, PyObject *, PyObject *, PyObject *)\000PyObject *(PyObject *, struct __pyx_obj_10pyreadstat_16_readstat_parser_dat""a_container *)\000PyObject *(__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format, double, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, PyObject *, int, PyObject *, double)\000PyObject *(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)\000\000__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format (PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format)\000int (char *, readstat_value_t, char *, void *)\000int (int, char *, void *)\000int (int, readstat_variable_t *, char *, void *)\000int (int, readstat_variable_t *, readstat_value_t, void *)\000int (readstat_metadata_t *, void *)\000void (char *, struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension, long, long, struct __pyx_opt_args_10pyreadstat_16_readstat_parser_run_readstat_parser *__pyx_optional_args)\000void (readstat_error_t)\000run_conversion\000dict_to_dataframe\000transform_datetime\000data_container_extract_metadata\000data_container_to_dict\000transform_variable_format\000handle_value_label\000handle_note\000handle_variable\000handle_value\000handle_metadata\000run_readstat_parser\000check_exit_statusPyObject *\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000readstat_to_numpy_types\000sas_all_formats\000sas_date_formats\000sas_datetime_formats\000sas_origin\000sas_time_formats\000spss_all_formats\000spss_date_formats\000spss_datetime_formats\000spss_origin\000spss_time_formats\000stata_all_formats\000stata_date_formats\000stata_datetime_formats\000stata_origin\000stata_time_formats\200\001\330\004\n\210+\220Q\320\000&\240a\330\027+\2501\330\r'\320'J\320J]\320]p\320pq\330\r0\3200A\320AS\320Sk\320kl\330\r+\2501\360\014\000\005\010\200~\220S\230\001\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!""\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\340\010\016\210o\230Q\230a\340\004\031\230\021\330\004\007\200q\330\010\023\2201\340\004 \240\001\330\004\007\200q\330\010\032\230!\340\004\030\230\001\330\004\007\200q\330\010\022\220!\340\004'\240q\330\004\007\200q\330\010!\240\021\340\004\020\220\013\230>\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\340\004\013\210<\220q"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif PyObject **stringtab = __pyx_mstate->__pyx_string_tab; Py_ssize_t pos = 0; - for (int i = 0; i < 290; i++) { + for (int i = 0; i < 291; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); if (likely(string) && i >= 54) PyUnicode_InternInPlace(&string); @@ -21999,7 +22155,7 @@ const char* const bytes = "^([A-Z][A-Z0-9]+[A-Z])(\\d+)?(?(2)(?:\\.\\d+)?$|$)Fai stringtab[i] = string; pos += bytes_length; } - for (int i = 290; i < 295; i++) { + for (int i = 291; i < 296; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -22010,14 +22166,14 @@ const char* const bytes = "^([A-Z][A-Z0-9]+[A-Z])(\\d+)?(?(2)(?:\\.\\d+)?$|$)Fai } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 295; i++) { + for (Py_ssize_t i = 0; i < 296; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 290; + PyObject **table = stringtab + 291; for (Py_ssize_t i=0; i<5; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #if PY_VERSION_HEX < 0x030E0000 @@ -22109,7 +22265,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1364}; + const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1373}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_parser_format, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_user_missing, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_parser_pyx, __pyx_mstate->__pyx_n_u_parser_entry_point, __pyx_mstate->__pyx_kp_b_iso88591_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } diff --git a/pyreadstat/_readstat_parser.pxd b/pyreadstat/_readstat_parser.pxd index e6b77eb..23ed07f 100644 --- a/pyreadstat/_readstat_parser.pxd +++ b/pyreadstat/_readstat_parser.pxd @@ -64,6 +64,7 @@ cdef class data_container: cdef list col_dytpes_isfloat cdef list col_formats cdef list col_formats_original + cdef list col_informats_original cdef object origin cdef double unix_to_origin_secs cdef py_file_format file_format diff --git a/pyreadstat/_readstat_parser.pyx b/pyreadstat/_readstat_parser.pyx index 802fd4c..bd43be1 100644 --- a/pyreadstat/_readstat_parser.pyx +++ b/pyreadstat/_readstat_parser.pyx @@ -101,6 +101,7 @@ cdef class data_container: self.col_dytpes_isfloat = list() self.col_formats = list() self.col_formats_original = list() + self.col_informats_original = list() self.origin = None self.unix_to_origin_secs = 0 self.is_unkown_number_rows = 0 @@ -293,7 +294,7 @@ cdef object convert_readstat_to_python_value(readstat_value_t value, int index, cdef py_file_format file_format cdef object result - cdef char * c_str_value + cdef const char * c_str_value cdef str py_str_value cdef int8_t c_int8_value cdef int16_t c_int16_value @@ -385,15 +386,15 @@ cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READST cdef int var_count, obs_count, mr_len cdef data_container dc = ctx #cdef object row - cdef char * flabel_orig - cdef char * fencoding_orig + cdef const char * flabel_orig + cdef const char * fencoding_orig cdef str flabel, fencoding cdef bint metaonly - cdef char * table + cdef const char * table cdef int ctime cdef int mtime cdef int i = 0 - cdef mr_set_t * mr_sets_orig + cdef const mr_set_t * mr_sets_orig cdef dict mr_sets = {} cdef str name cdef list variable_list = [] @@ -468,10 +469,11 @@ cdef int handle_variable(int index, readstat_variable_t *variable, if any. """ - cdef char * var_name, - cdef char * var_label - cdef char * var_format - cdef str col_name, col_label, label_name, col_format_original, output_format + cdef const char * var_name, + cdef const char * var_label + cdef const char * var_format + cdef const char * var_informat + cdef str col_name, col_label, label_name, col_format_original, col_informat_original, output_format cdef py_datetime_format col_format_final cdef readstat_type_t var_type cdef py_file_format file_format @@ -541,8 +543,15 @@ cdef int handle_variable(int index, readstat_variable_t *variable, col_format_original = None else: col_format_original = var_format + # informat (SAS) + var_informat = readstat_variable_get_informat(variable) + if var_informat == NULL: + col_informat_original = None + else: + col_informat_original = var_informat file_format = dc.file_format dc.col_formats_original.append(col_format_original) + dc.col_informats_original.append(col_informat_original) col_format_final = transform_variable_format(col_format_original, file_format) dc.col_formats.append(col_format_final) # readstat type @@ -742,7 +751,7 @@ cdef int handle_value_label(char *val_labels, readstat_value_t value, char *labe cdef data_container dc = ctx - cdef char * c_str_value + cdef const char * c_str_value cdef str py_str_value cdef int8_t c_int8_value cdef int16_t c_int16_value @@ -852,7 +861,6 @@ cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ return -1 -cdef object _file_object_ctx = None cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: """File is already open - this is a no-op""" @@ -864,13 +872,12 @@ cdef int pyobject_close_handler(void *io_ctx) noexcept: cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: """Bridge Python file.read() to C read operation""" - global _file_object_ctx cdef bytes data cdef ssize_t bytes_read cdef char *data_ptr - + cdef object file_obj = io_ctx + try: - file_obj = _file_object_ctx data = file_obj.read(nbyte) bytes_read = len(data) if bytes_read > 0: @@ -882,18 +889,17 @@ cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexce cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: """Bridge Python file.seek() to C seek operation""" - global _file_object_ctx cdef int py_whence - + cdef object file_obj = io_ctx + try: - file_obj = _file_object_ctx if whence == READSTAT_SEEK_SET: py_whence = 0 elif whence == READSTAT_SEEK_CUR: py_whence = 1 else: # READSTAT_SEEK_END py_whence = 2 - + file_obj.seek(offset, py_whence) return file_obj.tell() except: @@ -905,7 +911,7 @@ cdef void check_exit_status(readstat_error_t retcode) except *: transforms a readstat exit status to a python error if status is not READSTAT OK """ - cdef char * err_readstat + cdef const char * err_readstat cdef str err_message if retcode != READSTAT_OK: err_readstat = readstat_error_message(retcode) @@ -916,11 +922,9 @@ cdef void check_exit_status(readstat_error_t retcode) except *: cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: """ Runs the parsing of the file by readstat library. - + If file_obj is provided, it will be used instead of filename for I/O operations. """ - global _file_object_ctx - cdef readstat_parser_t *parser cdef readstat_error_t error cdef readstat_metadata_handler metadata_handler @@ -943,7 +947,7 @@ cdef void run_readstat_parser(char * filename, data_container data, py_file_exte metaonly = data.metaonly ctx = data - #readstat_error_t error = READSTAT_OK; + error = READSTAT_OK; parser = readstat_parser_init() metadata_handler = handle_metadata variable_handler = handle_variable @@ -959,11 +963,12 @@ cdef void run_readstat_parser(char * filename, data_container data, py_file_exte # Set up custom I/O handlers for file objects if file_obj is not None: - _file_object_ctx = file_obj + io_ctx = file_obj open_handler = pyobject_open_handler close_handler = pyobject_close_handler read_handler = pyobject_read_handler seek_handler = pyobject_seek_handler + readstat_set_io_ctx(parser, io_ctx) readstat_set_open_handler(parser, open_handler) readstat_set_close_handler(parser, close_handler) readstat_set_read_handler(parser, read_handler) @@ -1136,10 +1141,10 @@ cdef object data_container_extract_metadata(data_container data): cdef bint is_unkown_number_rows cdef object label_to_var_name cdef object labels_raw - cdef str var_name, var_label + cdef str var_name, var_label, cur_type, cur_informat cdef object current_labels cdef object labels_str - cdef object original_types + cdef object original_types, original_informats cdef readstat_type_t var_type metaonly = data.metaonly @@ -1170,11 +1175,14 @@ cdef object data_container_extract_metadata(data_container data): variable_value_labels[var_name] = current_labels original_types = dict() + original_informats = dict() readstat_types = dict() for indx in range(metadata.number_columns): cur_col = data.col_names[indx] cur_type = data.col_formats_original[indx] original_types[cur_col] = cur_type + cur_informat = data.col_informats_original[indx] + original_informats[cur_col] = cur_informat var_type = data.col_dtypes[indx] if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: readstat_types[cur_col] = "string" @@ -1205,6 +1213,7 @@ cdef object data_container_extract_metadata(data_container data): metadata.value_labels = labels_raw metadata.variable_to_label = label_to_var_name metadata.original_variable_types = original_types + metadata.original_variable_informats = original_informats metadata.readstat_variable_types = readstat_types metadata.table_name = data.table_name metadata.missing_ranges = data.missing_ranges diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index f899195..5794730 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -1199,6 +1199,7 @@ static int __Pyx_init_co_variables(void) { #include "readstat.h" #include "readstat_io_unistd.h" #include "conditional_includes.h" +#include #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -1717,6 +1718,7 @@ struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container { PyObject *col_dytpes_isfloat; PyObject *col_formats; PyObject *col_formats_original; + PyObject *col_informats_original; PyObject *origin; double unix_to_origin_secs; __pyx_t_10pyreadstat_16_readstat_parser_py_file_format file_format; @@ -2301,6 +2303,15 @@ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif +/* CIntToPyUnicode.proto */ +#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\ + ((format_char) == ('c')) ?\ + __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\ + __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\ + ) +static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char); +static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); + /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); @@ -2680,6 +2691,12 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value); +/* CIntFromPy.proto */ +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyLong_As_PY_LONG_LONG(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PY_LONG_LONG(PY_LONG_LONG value); + /* CIntFromPy.proto */ static CYTHON_INLINE readstat_type_t __Pyx_PyLong_As_readstat_type_t(PyObject *); @@ -2800,6 +2817,8 @@ static int __Pyx_State_RemoveModule(void*); /* Module declarations from "pyreadstat.readstat_api" */ +/* Module declarations from "libc.errno" */ + /* Module declarations from "pyreadstat._readstat_parser" */ static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types = 0; #define __pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types (*__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types) @@ -2865,7 +2884,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *); /*prot static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int); /*proto*/ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObject *); /*proto*/ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *); /*proto*/ -static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int); /*proto*/ +static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int); /*proto*/ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_label(readstat_writer_t *, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *); /*proto*/ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject *, readstat_variable_t *, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *); /*proto*/ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(readstat_variable_t *, PyObject *, PyObject *); /*proto*/ @@ -2882,7 +2901,7 @@ int __pyx_module_is_main_pyreadstat___readstat_writer = 0; static PyObject *__pyx_builtin_zip; /* #### Code section: string_decls ### */ /* #### Code section: decls ### */ -static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_writer_format, PyObject *__pyx_v_file_label, int __pyx_v_version, PyObject *__pyx_v_table_name, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_alignment); /* proto */ +static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_writer_format, PyObject *__pyx_v_file_label, int __pyx_v_version, PyObject *__pyx_v_table_name, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_alignment, PyObject *__pyx_v_variable_informat); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -2911,8 +2930,8 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; PyObject *__pyx_tuple[2]; PyObject *__pyx_codeobj_tab[1]; - PyObject *__pyx_string_tab[219]; - PyObject *__pyx_number_tab[9]; + PyObject *__pyx_string_tab[226]; + PyObject *__pyx_number_tab[10]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -2953,234 +2972,242 @@ static __pyx_mstatetype __pyx_mstate_global_static = static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: constant_name_defines ### */ -#define __pyx_kp_u_ __pyx_string_tab[0] -#define __pyx_kp_u_Column_labels_must_be_strings __pyx_string_tab[1] +#define __pyx_kp_u_Column_labels_must_be_strings __pyx_string_tab[0] +#define __pyx_kp_u_Could_not_open_file __pyx_string_tab[1] #define __pyx_kp_u_Non_unique_column_names_detected __pyx_string_tab[2] #define __pyx_kp_u_None __pyx_string_tab[3] #define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[4] -#define __pyx_kp_u_Unknown_data_format_to_insert __pyx_string_tab[5] -#define __pyx_kp_u_Unknown_pywriter_variable_format __pyx_string_tab[6] -#define __pyx_kp_u_Version_not_supported __pyx_string_tab[7] -#define __pyx_kp_u__2 __pyx_string_tab[8] -#define __pyx_kp_u__3 __pyx_string_tab[9] -#define __pyx_kp_u__4 __pyx_string_tab[10] -#define __pyx_kp_u__6 __pyx_string_tab[11] -#define __pyx_kp_u_add_note __pyx_string_tab[12] -#define __pyx_kp_u_alignment_for_variable __pyx_string_tab[13] -#define __pyx_kp_u_and_it_must_be_str_not_starting __pyx_string_tab[14] -#define __pyx_kp_u_character_missing_ranges_value_g __pyx_string_tab[15] -#define __pyx_kp_u_column_labels_must_be_either_lis __pyx_string_tab[16] -#define __pyx_kp_u_compress_and_row_compress_cannot __pyx_string_tab[17] -#define __pyx_kp_u_dataframe_must_be_pandas_or_pola __pyx_string_tab[18] -#define __pyx_kp_u_dictionaries_in_missing_ranges_m __pyx_string_tab[19] -#define __pyx_kp_u_does_not_exist __pyx_string_tab[20] -#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[21] -#define __pyx_kp_u_in_variable __pyx_string_tab[22] -#define __pyx_kp_u_instead __pyx_string_tab[23] -#define __pyx_kp_u_is_of_type __pyx_string_tab[24] -#define __pyx_kp_u_length_of_column_labels_must_be __pyx_string_tab[25] -#define __pyx_kp_u_measure_for_variable __pyx_string_tab[26] -#define __pyx_kp_u_missing_ranges_hi_and_lo_values __pyx_string_tab[27] -#define __pyx_kp_u_missing_ranges_hi_and_lo_values_2 __pyx_string_tab[28] -#define __pyx_kp_u_missing_ranges_max_1_discrete_nu __pyx_string_tab[29] -#define __pyx_kp_u_missing_ranges_max_1_range_value __pyx_string_tab[30] -#define __pyx_kp_u_missing_ranges_max_3_discrete_nu __pyx_string_tab[31] -#define __pyx_kp_u_missing_ranges_max_3_string_valu __pyx_string_tab[32] -#define __pyx_kp_u_missing_ranges_string_values_len __pyx_string_tab[33] -#define __pyx_kp_u_missing_ranges_values_in_diction __pyx_string_tab[34] -#define __pyx_kp_u_missing_ranges_values_must_be_bo __pyx_string_tab[35] -#define __pyx_kp_u_missing_user_values_not_allowed __pyx_string_tab[36] -#define __pyx_kp_u_missing_user_values_supports_val __pyx_string_tab[37] -#define __pyx_kp_u_missing_user_values_values_in_di __pyx_string_tab[38] -#define __pyx_kp_u_must_be_boolean_or_be_1_or_0 __pyx_string_tab[39] -#define __pyx_kp_u_must_be_dict_got __pyx_string_tab[40] -#define __pyx_kp_u_must_be_either_nominal_ordinal __pyx_string_tab[41] -#define __pyx_kp_u_must_be_either_right_center_lef __pyx_string_tab[42] -#define __pyx_kp_u_must_be_int __pyx_string_tab[43] -#define __pyx_kp_u_must_be_numeric __pyx_string_tab[44] -#define __pyx_kp_u_must_be_string __pyx_string_tab[45] -#define __pyx_kp_u_must_match_the_type_of_the_colu __pyx_string_tab[46] -#define __pyx_kp_u_note_should_be_either_str_or_lis __pyx_string_tab[47] -#define __pyx_kp_u_numeric_missing_ranges_value_giv __pyx_string_tab[48] -#define __pyx_kp_u_ordinal_2 __pyx_string_tab[49] -#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[50] -#define __pyx_kp_u_pyreadstat__readstat_parser __pyx_string_tab[51] -#define __pyx_kp_u_pyreadstat__readstat_writer_pyx __pyx_string_tab[52] -#define __pyx_kp_u_pyreadstat_datetime __pyx_string_tab[53] -#define __pyx_kp_u_pyreadstat_narwhals_stable_v2 __pyx_string_tab[54] -#define __pyx_kp_u_pyreadstat_numpy __pyx_string_tab[55] -#define __pyx_kp_u_pyreadstat_os __pyx_string_tab[56] -#define __pyx_kp_u_pyreadstat_sys __pyx_string_tab[57] -#define __pyx_kp_u_pyreadstat_warnings __pyx_string_tab[58] -#define __pyx_kp_u_starts_with_an_illegal_non_alph __pyx_string_tab[59] -#define __pyx_kp_u_the_destination_folder __pyx_string_tab[60] -#define __pyx_kp_u_unknown_file_format __pyx_string_tab[61] -#define __pyx_kp_u_utf_8 __pyx_string_tab[62] -#define __pyx_kp_u_variable_name __pyx_string_tab[63] -#define __pyx_kp_u_variable_name_s_contains_a_space __pyx_string_tab[64] -#define __pyx_kp_u_variable_names_must_be_non_empty __pyx_string_tab[65] -#define __pyx_kp_u_variable_value_labels_type_of_La __pyx_string_tab[66] -#define __pyx_kp_u_variable_value_labels_type_of_Va __pyx_string_tab[67] -#define __pyx_kp_u_variable_value_labels_value_for __pyx_string_tab[68] -#define __pyx_kp_u_wrong_writer_format __pyx_string_tab[69] -#define __pyx_n_u_Boolean __pyx_string_tab[70] -#define __pyx_n_u_Categorical __pyx_string_tab[71] -#define __pyx_n_u_Date __pyx_string_tab[72] -#define __pyx_n_u_Datetime __pyx_string_tab[73] -#define __pyx_n_u_Decimal __pyx_string_tab[74] -#define __pyx_n_u_Enum __pyx_string_tab[75] -#define __pyx_n_u_Float32 __pyx_string_tab[76] -#define __pyx_n_u_Float64 __pyx_string_tab[77] -#define __pyx_n_u_Int128 __pyx_string_tab[78] -#define __pyx_n_u_Int16 __pyx_string_tab[79] -#define __pyx_n_u_Int32 __pyx_string_tab[80] -#define __pyx_n_u_Int64 __pyx_string_tab[81] -#define __pyx_n_u_Int8 __pyx_string_tab[82] -#define __pyx_n_u_Object __pyx_string_tab[83] -#define __pyx_n_u_PyreadstatError __pyx_string_tab[84] -#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[85] -#define __pyx_n_u_ReadstatError __pyx_string_tab[86] -#define __pyx_n_u_String __pyx_string_tab[87] -#define __pyx_n_u_Time __pyx_string_tab[88] -#define __pyx_n_u_UInt128 __pyx_string_tab[89] -#define __pyx_n_u_UInt16 __pyx_string_tab[90] -#define __pyx_n_u_UInt32 __pyx_string_tab[91] -#define __pyx_n_u_UInt64 __pyx_string_tab[92] -#define __pyx_n_u_UInt8 __pyx_string_tab[93] -#define __pyx_n_u__5 __pyx_string_tab[94] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[95] -#define __pyx_n_u_cast __pyx_string_tab[96] -#define __pyx_n_u_cat __pyx_string_tab[97] -#define __pyx_n_u_center __pyx_string_tab[98] -#define __pyx_n_u_class_getitem __pyx_string_tab[99] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[100] -#define __pyx_n_u_clone __pyx_string_tab[101] -#define __pyx_n_u_column_labels __pyx_string_tab[102] -#define __pyx_n_u_columns __pyx_string_tab[103] -#define __pyx_n_u_combine __pyx_string_tab[104] -#define __pyx_n_u_compress __pyx_string_tab[105] -#define __pyx_n_u_date __pyx_string_tab[106] -#define __pyx_n_u_datetime __pyx_string_tab[107] -#define __pyx_n_u_datetime64 __pyx_string_tab[108] -#define __pyx_n_u_days __pyx_string_tab[109] -#define __pyx_n_u_df __pyx_string_tab[110] -#define __pyx_n_u_dirname __pyx_string_tab[111] -#define __pyx_n_u_drop_nulls __pyx_string_tab[112] -#define __pyx_n_u_dst_path __pyx_string_tab[113] -#define __pyx_n_u_dta __pyx_string_tab[114] -#define __pyx_n_u_dtype __pyx_string_tab[115] -#define __pyx_n_u_eager_only __pyx_string_tab[116] -#define __pyx_n_u_encode __pyx_string_tab[117] -#define __pyx_n_u_expanduser __pyx_string_tab[118] -#define __pyx_n_u_file_format_version __pyx_string_tab[119] -#define __pyx_n_u_file_label __pyx_string_tab[120] -#define __pyx_n_u_filter __pyx_string_tab[121] -#define __pyx_n_u_from_native __pyx_string_tab[122] -#define __pyx_n_u_fsdecode __pyx_string_tab[123] -#define __pyx_n_u_fsencode __pyx_string_tab[124] -#define __pyx_n_u_func __pyx_string_tab[125] -#define __pyx_n_u_get __pyx_string_tab[126] -#define __pyx_n_u_get_categories __pyx_string_tab[127] -#define __pyx_n_u_get_native_namespace __pyx_string_tab[128] -#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[129] -#define __pyx_n_u_hi __pyx_string_tab[130] -#define __pyx_n_u_implementation __pyx_string_tab[131] -#define __pyx_n_u_is_coroutine __pyx_string_tab[132] -#define __pyx_n_u_is_in __pyx_string_tab[133] -#define __pyx_n_u_is_pandas __pyx_string_tab[134] -#define __pyx_n_u_is_polars __pyx_string_tab[135] -#define __pyx_n_u_isalpha __pyx_string_tab[136] -#define __pyx_n_u_isdir __pyx_string_tab[137] -#define __pyx_n_u_isna __pyx_string_tab[138] -#define __pyx_n_u_items __pyx_string_tab[139] -#define __pyx_n_u_iter_columns __pyx_string_tab[140] -#define __pyx_n_u_iter_rows __pyx_string_tab[141] -#define __pyx_n_u_keys __pyx_string_tab[142] -#define __pyx_n_u_left __pyx_string_tab[143] -#define __pyx_n_u_lo __pyx_string_tab[144] -#define __pyx_n_u_main __pyx_string_tab[145] -#define __pyx_n_u_min __pyx_string_tab[146] -#define __pyx_n_u_missing_ranges __pyx_string_tab[147] -#define __pyx_n_u_missing_user_values __pyx_string_tab[148] -#define __pyx_n_u_module __pyx_string_tab[149] -#define __pyx_n_u_ms __pyx_string_tab[150] -#define __pyx_n_u_name __pyx_string_tab[151] -#define __pyx_n_u_name_2 __pyx_string_tab[152] -#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[153] -#define __pyx_n_u_nominal __pyx_string_tab[154] -#define __pyx_n_u_note __pyx_string_tab[155] -#define __pyx_n_u_np __pyx_string_tab[156] -#define __pyx_n_u_ns __pyx_string_tab[157] -#define __pyx_n_u_nt __pyx_string_tab[158] -#define __pyx_n_u_nth __pyx_string_tab[159] -#define __pyx_n_u_null_count __pyx_string_tab[160] -#define __pyx_n_u_numpy __pyx_string_tab[161] -#define __pyx_n_u_nw __pyx_string_tab[162] -#define __pyx_n_u_ordinal __pyx_string_tab[163] -#define __pyx_n_u_os __pyx_string_tab[164] -#define __pyx_n_u_path __pyx_string_tab[165] -#define __pyx_n_u_pop __pyx_string_tab[166] -#define __pyx_n_u_por __pyx_string_tab[167] -#define __pyx_n_u_pyreadstat__readstat_writer __pyx_string_tab[168] -#define __pyx_n_u_pyx_capi __pyx_string_tab[169] -#define __pyx_n_u_qualname __pyx_string_tab[170] -#define __pyx_n_u_readstat_parser __pyx_string_tab[171] -#define __pyx_n_u_replace __pyx_string_tab[172] -#define __pyx_n_u_right __pyx_string_tab[173] -#define __pyx_n_u_round __pyx_string_tab[174] -#define __pyx_n_u_row_compress __pyx_string_tab[175] -#define __pyx_n_u_row_compression __pyx_string_tab[176] -#define __pyx_n_u_sav __pyx_string_tab[177] -#define __pyx_n_u_scale __pyx_string_tab[178] -#define __pyx_n_u_set_name __pyx_string_tab[179] -#define __pyx_n_u_setdefault __pyx_string_tab[180] -#define __pyx_n_u_stable __pyx_string_tab[181] -#define __pyx_n_u_surrogateescape __pyx_string_tab[182] -#define __pyx_n_u_sys __pyx_string_tab[183] -#define __pyx_n_u_table_name __pyx_string_tab[184] -#define __pyx_n_u_test __pyx_string_tab[185] -#define __pyx_n_u_then __pyx_string_tab[186] -#define __pyx_n_u_time __pyx_string_tab[187] -#define __pyx_n_u_time_unit __pyx_string_tab[188] -#define __pyx_n_u_timestamp __pyx_string_tab[189] -#define __pyx_n_u_timezone __pyx_string_tab[190] -#define __pyx_n_u_total_seconds __pyx_string_tab[191] -#define __pyx_n_u_tzinfo __pyx_string_tab[192] -#define __pyx_n_u_unknown __pyx_string_tab[193] -#define __pyx_n_u_upper __pyx_string_tab[194] -#define __pyx_n_u_us __pyx_string_tab[195] -#define __pyx_n_u_utc __pyx_string_tab[196] -#define __pyx_n_u_v2 __pyx_string_tab[197] -#define __pyx_n_u_values __pyx_string_tab[198] -#define __pyx_n_u_variable_alignment __pyx_string_tab[199] -#define __pyx_n_u_variable_display_width __pyx_string_tab[200] -#define __pyx_n_u_variable_format __pyx_string_tab[201] -#define __pyx_n_u_variable_measure __pyx_string_tab[202] -#define __pyx_n_u_variable_value_labels __pyx_string_tab[203] -#define __pyx_n_u_version __pyx_string_tab[204] -#define __pyx_n_u_warn __pyx_string_tab[205] -#define __pyx_n_u_warnings __pyx_string_tab[206] -#define __pyx_n_u_when __pyx_string_tab[207] -#define __pyx_n_u_with_columns __pyx_string_tab[208] -#define __pyx_n_u_writer_entry_point __pyx_string_tab[209] -#define __pyx_n_u_writer_file_format __pyx_string_tab[210] -#define __pyx_n_u_writer_format __pyx_string_tab[211] -#define __pyx_n_u_x __pyx_string_tab[212] -#define __pyx_n_u_xport __pyx_string_tab[213] -#define __pyx_n_u_zip __pyx_string_tab[214] -#define __pyx_kp_b_PyObject_PyObject_PyObject_PyObj __pyx_string_tab[215] -#define __pyx_kp_b_PyObject_readstat_to_numpy_types __pyx_string_tab[216] -#define __pyx_kp_b_iso88591_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a __pyx_string_tab[217] -#define __pyx_kp_b_void_readstat_error_t_check_exit __pyx_string_tab[218] +#define __pyx_kp_u_The_file_may_be_locked_by_anoth __pyx_string_tab[5] +#define __pyx_kp_u_Unknown_data_format_to_insert __pyx_string_tab[6] +#define __pyx_kp_u_Unknown_pywriter_variable_format __pyx_string_tab[7] +#define __pyx_kp_u_Version_not_supported __pyx_string_tab[8] +#define __pyx_kp_u__2 __pyx_string_tab[9] +#define __pyx_kp_u__3 __pyx_string_tab[10] +#define __pyx_kp_u__4 __pyx_string_tab[11] +#define __pyx_kp_u__5 __pyx_string_tab[12] +#define __pyx_kp_u__6 __pyx_string_tab[13] +#define __pyx_kp_u_add_note __pyx_string_tab[14] +#define __pyx_kp_u_alignment_for_variable __pyx_string_tab[15] +#define __pyx_kp_u_and_it_must_be_str_not_starting __pyx_string_tab[16] +#define __pyx_kp_u_character_missing_ranges_value_g __pyx_string_tab[17] +#define __pyx_kp_u_column_labels_must_be_either_lis __pyx_string_tab[18] +#define __pyx_kp_u_compress_and_row_compress_cannot __pyx_string_tab[19] +#define __pyx_kp_u_dataframe_must_be_pandas_or_pola __pyx_string_tab[20] +#define __pyx_kp_u_dictionaries_in_missing_ranges_m __pyx_string_tab[21] +#define __pyx_kp_u_does_not_exist __pyx_string_tab[22] +#define __pyx_kp_u_errno __pyx_string_tab[23] +#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[24] +#define __pyx_kp_u_for_writing __pyx_string_tab[25] +#define __pyx_kp_u_in_variable __pyx_string_tab[26] +#define __pyx_kp_u_instead __pyx_string_tab[27] +#define __pyx_kp_u_is_of_type __pyx_string_tab[28] +#define __pyx_kp_u_length_of_column_labels_must_be __pyx_string_tab[29] +#define __pyx_kp_u_measure_for_variable __pyx_string_tab[30] +#define __pyx_kp_u_missing_ranges_hi_and_lo_values __pyx_string_tab[31] +#define __pyx_kp_u_missing_ranges_hi_and_lo_values_2 __pyx_string_tab[32] +#define __pyx_kp_u_missing_ranges_max_1_discrete_nu __pyx_string_tab[33] +#define __pyx_kp_u_missing_ranges_max_1_range_value __pyx_string_tab[34] +#define __pyx_kp_u_missing_ranges_max_3_discrete_nu __pyx_string_tab[35] +#define __pyx_kp_u_missing_ranges_max_3_string_valu __pyx_string_tab[36] +#define __pyx_kp_u_missing_ranges_string_values_len __pyx_string_tab[37] +#define __pyx_kp_u_missing_ranges_values_in_diction __pyx_string_tab[38] +#define __pyx_kp_u_missing_ranges_values_must_be_bo __pyx_string_tab[39] +#define __pyx_kp_u_missing_user_values_not_allowed __pyx_string_tab[40] +#define __pyx_kp_u_missing_user_values_supports_val __pyx_string_tab[41] +#define __pyx_kp_u_missing_user_values_values_in_di __pyx_string_tab[42] +#define __pyx_kp_u_must_be_boolean_or_be_1_or_0 __pyx_string_tab[43] +#define __pyx_kp_u_must_be_dict_got __pyx_string_tab[44] +#define __pyx_kp_u_must_be_either_nominal_ordinal __pyx_string_tab[45] +#define __pyx_kp_u_must_be_either_right_center_lef __pyx_string_tab[46] +#define __pyx_kp_u_must_be_int __pyx_string_tab[47] +#define __pyx_kp_u_must_be_numeric __pyx_string_tab[48] +#define __pyx_kp_u_must_be_string __pyx_string_tab[49] +#define __pyx_kp_u_must_match_the_type_of_the_colu __pyx_string_tab[50] +#define __pyx_kp_u_note_should_be_either_str_or_lis __pyx_string_tab[51] +#define __pyx_kp_u_numeric_missing_ranges_value_giv __pyx_string_tab[52] +#define __pyx_kp_u_ordinal_2 __pyx_string_tab[53] +#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[54] +#define __pyx_kp_u_pyreadstat__readstat_parser __pyx_string_tab[55] +#define __pyx_kp_u_pyreadstat__readstat_writer_pyx __pyx_string_tab[56] +#define __pyx_kp_u_pyreadstat_datetime __pyx_string_tab[57] +#define __pyx_kp_u_pyreadstat_narwhals_stable_v2 __pyx_string_tab[58] +#define __pyx_kp_u_pyreadstat_numpy __pyx_string_tab[59] +#define __pyx_kp_u_pyreadstat_os __pyx_string_tab[60] +#define __pyx_kp_u_pyreadstat_sys __pyx_string_tab[61] +#define __pyx_kp_u_pyreadstat_warnings __pyx_string_tab[62] +#define __pyx_kp_u_starts_with_an_illegal_neither __pyx_string_tab[63] +#define __pyx_kp_u_the_destination_folder __pyx_string_tab[64] +#define __pyx_kp_u_unknown_file_format __pyx_string_tab[65] +#define __pyx_kp_u_utf_8 __pyx_string_tab[66] +#define __pyx_kp_u_variable_name __pyx_string_tab[67] +#define __pyx_kp_u_variable_name_s_contains_a_space __pyx_string_tab[68] +#define __pyx_kp_u_variable_names_must_be_non_empty __pyx_string_tab[69] +#define __pyx_kp_u_variable_value_labels_type_of_La __pyx_string_tab[70] +#define __pyx_kp_u_variable_value_labels_type_of_Va __pyx_string_tab[71] +#define __pyx_kp_u_variable_value_labels_value_for __pyx_string_tab[72] +#define __pyx_kp_u_wrong_writer_format __pyx_string_tab[73] +#define __pyx_n_u_ __pyx_string_tab[74] +#define __pyx_n_u_Boolean __pyx_string_tab[75] +#define __pyx_n_u_Categorical __pyx_string_tab[76] +#define __pyx_n_u_Date __pyx_string_tab[77] +#define __pyx_n_u_Datetime __pyx_string_tab[78] +#define __pyx_n_u_Decimal __pyx_string_tab[79] +#define __pyx_n_u_Enum __pyx_string_tab[80] +#define __pyx_n_u_Float32 __pyx_string_tab[81] +#define __pyx_n_u_Float64 __pyx_string_tab[82] +#define __pyx_n_u_Int128 __pyx_string_tab[83] +#define __pyx_n_u_Int16 __pyx_string_tab[84] +#define __pyx_n_u_Int32 __pyx_string_tab[85] +#define __pyx_n_u_Int64 __pyx_string_tab[86] +#define __pyx_n_u_Int8 __pyx_string_tab[87] +#define __pyx_n_u_Object __pyx_string_tab[88] +#define __pyx_n_u_PyreadstatError __pyx_string_tab[89] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[90] +#define __pyx_n_u_ReadstatError __pyx_string_tab[91] +#define __pyx_n_u_String __pyx_string_tab[92] +#define __pyx_n_u_Time __pyx_string_tab[93] +#define __pyx_n_u_UInt128 __pyx_string_tab[94] +#define __pyx_n_u_UInt16 __pyx_string_tab[95] +#define __pyx_n_u_UInt32 __pyx_string_tab[96] +#define __pyx_n_u_UInt64 __pyx_string_tab[97] +#define __pyx_n_u_UInt8 __pyx_string_tab[98] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[99] +#define __pyx_n_u_cast __pyx_string_tab[100] +#define __pyx_n_u_cat __pyx_string_tab[101] +#define __pyx_n_u_center __pyx_string_tab[102] +#define __pyx_n_u_class_getitem __pyx_string_tab[103] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[104] +#define __pyx_n_u_clone __pyx_string_tab[105] +#define __pyx_n_u_column_labels __pyx_string_tab[106] +#define __pyx_n_u_columns __pyx_string_tab[107] +#define __pyx_n_u_combine __pyx_string_tab[108] +#define __pyx_n_u_compress __pyx_string_tab[109] +#define __pyx_n_u_d __pyx_string_tab[110] +#define __pyx_n_u_date __pyx_string_tab[111] +#define __pyx_n_u_datetime __pyx_string_tab[112] +#define __pyx_n_u_datetime64 __pyx_string_tab[113] +#define __pyx_n_u_days __pyx_string_tab[114] +#define __pyx_n_u_df __pyx_string_tab[115] +#define __pyx_n_u_dirname __pyx_string_tab[116] +#define __pyx_n_u_drop_nulls __pyx_string_tab[117] +#define __pyx_n_u_dst_path __pyx_string_tab[118] +#define __pyx_n_u_dta __pyx_string_tab[119] +#define __pyx_n_u_dtype __pyx_string_tab[120] +#define __pyx_n_u_eager_only __pyx_string_tab[121] +#define __pyx_n_u_encode __pyx_string_tab[122] +#define __pyx_n_u_expanduser __pyx_string_tab[123] +#define __pyx_n_u_file_format_version __pyx_string_tab[124] +#define __pyx_n_u_file_label __pyx_string_tab[125] +#define __pyx_n_u_filter __pyx_string_tab[126] +#define __pyx_n_u_from_native __pyx_string_tab[127] +#define __pyx_n_u_fsdecode __pyx_string_tab[128] +#define __pyx_n_u_fsencode __pyx_string_tab[129] +#define __pyx_n_u_func __pyx_string_tab[130] +#define __pyx_n_u_get __pyx_string_tab[131] +#define __pyx_n_u_get_categories __pyx_string_tab[132] +#define __pyx_n_u_get_native_namespace __pyx_string_tab[133] +#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[134] +#define __pyx_n_u_hi __pyx_string_tab[135] +#define __pyx_n_u_implementation __pyx_string_tab[136] +#define __pyx_n_u_is_coroutine __pyx_string_tab[137] +#define __pyx_n_u_is_in __pyx_string_tab[138] +#define __pyx_n_u_is_pandas __pyx_string_tab[139] +#define __pyx_n_u_is_polars __pyx_string_tab[140] +#define __pyx_n_u_isalpha __pyx_string_tab[141] +#define __pyx_n_u_isdir __pyx_string_tab[142] +#define __pyx_n_u_isna __pyx_string_tab[143] +#define __pyx_n_u_items __pyx_string_tab[144] +#define __pyx_n_u_iter_columns __pyx_string_tab[145] +#define __pyx_n_u_iter_rows __pyx_string_tab[146] +#define __pyx_n_u_keys __pyx_string_tab[147] +#define __pyx_n_u_left __pyx_string_tab[148] +#define __pyx_n_u_lo __pyx_string_tab[149] +#define __pyx_n_u_main __pyx_string_tab[150] +#define __pyx_n_u_min __pyx_string_tab[151] +#define __pyx_n_u_missing_ranges __pyx_string_tab[152] +#define __pyx_n_u_missing_user_values __pyx_string_tab[153] +#define __pyx_n_u_module __pyx_string_tab[154] +#define __pyx_n_u_ms __pyx_string_tab[155] +#define __pyx_n_u_name __pyx_string_tab[156] +#define __pyx_n_u_name_2 __pyx_string_tab[157] +#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[158] +#define __pyx_n_u_nominal __pyx_string_tab[159] +#define __pyx_n_u_note __pyx_string_tab[160] +#define __pyx_n_u_np __pyx_string_tab[161] +#define __pyx_n_u_ns __pyx_string_tab[162] +#define __pyx_n_u_nt __pyx_string_tab[163] +#define __pyx_n_u_nth __pyx_string_tab[164] +#define __pyx_n_u_null_count __pyx_string_tab[165] +#define __pyx_n_u_numpy __pyx_string_tab[166] +#define __pyx_n_u_nw __pyx_string_tab[167] +#define __pyx_n_u_ordinal __pyx_string_tab[168] +#define __pyx_n_u_os __pyx_string_tab[169] +#define __pyx_n_u_path __pyx_string_tab[170] +#define __pyx_n_u_pop __pyx_string_tab[171] +#define __pyx_n_u_por __pyx_string_tab[172] +#define __pyx_n_u_pyreadstat__readstat_writer __pyx_string_tab[173] +#define __pyx_n_u_pyx_capi __pyx_string_tab[174] +#define __pyx_n_u_qualname __pyx_string_tab[175] +#define __pyx_n_u_readstat_parser __pyx_string_tab[176] +#define __pyx_n_u_replace __pyx_string_tab[177] +#define __pyx_n_u_right __pyx_string_tab[178] +#define __pyx_n_u_round __pyx_string_tab[179] +#define __pyx_n_u_row_compress __pyx_string_tab[180] +#define __pyx_n_u_row_compression __pyx_string_tab[181] +#define __pyx_n_u_sav __pyx_string_tab[182] +#define __pyx_n_u_scale __pyx_string_tab[183] +#define __pyx_n_u_set_name __pyx_string_tab[184] +#define __pyx_n_u_setdefault __pyx_string_tab[185] +#define __pyx_n_u_stable __pyx_string_tab[186] +#define __pyx_n_u_strerror __pyx_string_tab[187] +#define __pyx_n_u_surrogateescape __pyx_string_tab[188] +#define __pyx_n_u_sys __pyx_string_tab[189] +#define __pyx_n_u_table_name __pyx_string_tab[190] +#define __pyx_n_u_test __pyx_string_tab[191] +#define __pyx_n_u_then __pyx_string_tab[192] +#define __pyx_n_u_time __pyx_string_tab[193] +#define __pyx_n_u_time_unit __pyx_string_tab[194] +#define __pyx_n_u_timestamp __pyx_string_tab[195] +#define __pyx_n_u_timezone __pyx_string_tab[196] +#define __pyx_n_u_total_seconds __pyx_string_tab[197] +#define __pyx_n_u_tzinfo __pyx_string_tab[198] +#define __pyx_n_u_unknown __pyx_string_tab[199] +#define __pyx_n_u_upper __pyx_string_tab[200] +#define __pyx_n_u_us __pyx_string_tab[201] +#define __pyx_n_u_utc __pyx_string_tab[202] +#define __pyx_n_u_v2 __pyx_string_tab[203] +#define __pyx_n_u_values __pyx_string_tab[204] +#define __pyx_n_u_variable_alignment __pyx_string_tab[205] +#define __pyx_n_u_variable_display_width __pyx_string_tab[206] +#define __pyx_n_u_variable_format __pyx_string_tab[207] +#define __pyx_n_u_variable_informat __pyx_string_tab[208] +#define __pyx_n_u_variable_measure __pyx_string_tab[209] +#define __pyx_n_u_variable_value_labels __pyx_string_tab[210] +#define __pyx_n_u_version __pyx_string_tab[211] +#define __pyx_n_u_warn __pyx_string_tab[212] +#define __pyx_n_u_warnings __pyx_string_tab[213] +#define __pyx_n_u_when __pyx_string_tab[214] +#define __pyx_n_u_with_columns __pyx_string_tab[215] +#define __pyx_n_u_writer_entry_point __pyx_string_tab[216] +#define __pyx_n_u_writer_file_format __pyx_string_tab[217] +#define __pyx_n_u_writer_format __pyx_string_tab[218] +#define __pyx_n_u_x __pyx_string_tab[219] +#define __pyx_n_u_xport __pyx_string_tab[220] +#define __pyx_n_u_zip __pyx_string_tab[221] +#define __pyx_kp_b_PyObject_PyObject_PyObject_PyObj __pyx_string_tab[222] +#define __pyx_kp_b_PyObject_readstat_to_numpy_types __pyx_string_tab[223] +#define __pyx_kp_b_iso88591_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a __pyx_string_tab[224] +#define __pyx_kp_b_void_readstat_error_t_check_exit __pyx_string_tab[225] #define __pyx_float_1e3 __pyx_number_tab[0] #define __pyx_float_1e6 __pyx_number_tab[1] #define __pyx_float_1e9 __pyx_number_tab[2] #define __pyx_int_0 __pyx_number_tab[3] #define __pyx_int_1 __pyx_number_tab[4] -#define __pyx_int_65 __pyx_number_tab[5] -#define __pyx_int_97 __pyx_number_tab[6] -#define __pyx_int_1970 __pyx_number_tab[7] -#define __pyx_int_neg_9223372036854775808 __pyx_number_tab[8] +#define __pyx_int_9 __pyx_number_tab[5] +#define __pyx_int_65 __pyx_number_tab[6] +#define __pyx_int_97 __pyx_number_tab[7] +#define __pyx_int_1970 __pyx_number_tab[8] +#define __pyx_int_neg_9223372036854775808 __pyx_number_tab[9] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3198,8 +3225,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<219; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } + for (int i=0; i<226; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<10; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_clear_contents ### */ /* CommonTypesMetaclass.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); @@ -3225,8 +3252,8 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<219; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } + for (int i=0; i<226; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<10; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_traverse_contents ### */ /* CommonTypesMetaclass.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); @@ -3240,7 +3267,7 @@ return 0; #endif /* #### Code section: module_code ### */ -/* "pyreadstat/_readstat_writer.pyx":62 +/* "pyreadstat/_readstat_writer.pyx":63 * cdef int dta_117_max_width = 2045 * * cdef object vectorized_convert_datetime_to_number(object df, dst_file_format file_format, list pywriter_types, list pywriter_timeunits, int col_count): # <<<<<<<<<<<<<< @@ -3250,11 +3277,13 @@ return 0; static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number(PyObject *__pyx_v_df, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_v_file_format, PyObject *__pyx_v_pywriter_types, PyObject *__pyx_v_pywriter_timeunits, int __pyx_v_col_count) { PyObject *__pyx_v_convfacs = 0; - double __pyx_v_offset_secs; - double __pyx_v_mulfac; + PY_LONG_LONG __pyx_v_offset_secs; + int __pyx_v_mulfac; int __pyx_v_col_indx; PyObject *__pyx_v_col_indxs = 0; - double __pyx_v_convfac; + int __pyx_v_convfac; + PyObject *__pyx_v_whole = NULL; + PyObject *__pyx_v_frac = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -3272,123 +3301,122 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date PyObject *__pyx_t_13 = NULL; size_t __pyx_t_14; Py_ssize_t __pyx_t_15; - double __pyx_t_16; + PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vectorized_convert_datetime_to_number", 0); __Pyx_INCREF(__pyx_v_df); - /* "pyreadstat/_readstat_writer.pyx":68 + /* "pyreadstat/_readstat_writer.pyx":69 * cdef dict convfacs - * cdef double offset_secs - * cdef double mulfac = 1.0 # <<<<<<<<<<<<<< + * cdef long long offset_secs + * cdef int mulfac = 1 # <<<<<<<<<<<<<< * cdef int col_indx * cdef list col_indxs */ - __pyx_v_mulfac = 1.0; + __pyx_v_mulfac = 1; - /* "pyreadstat/_readstat_writer.pyx":73 - * cdef double convfac + /* "pyreadstat/_readstat_writer.pyx":74 + * cdef int convfac * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< - * offset_secs = spss_offset_secs + * offset_secs = int(spss_offset_secs) * else: */ switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":74 + /* "pyreadstat/_readstat_writer.pyx":75 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: - * offset_secs = spss_offset_secs # <<<<<<<<<<<<<< + * offset_secs = int(spss_offset_secs) # <<<<<<<<<<<<<< * else: - * offset_secs = sas_offset_secs + * offset_secs = int(sas_offset_secs) */ - __pyx_v_offset_secs = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs; + __pyx_v_offset_secs = ((PY_LONG_LONG)__pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs); - /* "pyreadstat/_readstat_writer.pyx":73 - * cdef double convfac + /* "pyreadstat/_readstat_writer.pyx":74 + * cdef int convfac * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< - * offset_secs = spss_offset_secs + * offset_secs = int(spss_offset_secs) * else: */ break; default: - /* "pyreadstat/_readstat_writer.pyx":76 - * offset_secs = spss_offset_secs + /* "pyreadstat/_readstat_writer.pyx":77 + * offset_secs = int(spss_offset_secs) * else: - * offset_secs = sas_offset_secs # <<<<<<<<<<<<<< + * offset_secs = int(sas_offset_secs) # <<<<<<<<<<<<<< * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds */ - __pyx_v_offset_secs = __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_secs; + __pyx_v_offset_secs = ((PY_LONG_LONG)__pyx_v_10pyreadstat_16_readstat_writer_sas_offset_secs); break; } - /* "pyreadstat/_readstat_writer.pyx":77 + /* "pyreadstat/_readstat_writer.pyx":78 * else: - * offset_secs = sas_offset_secs + * offset_secs = int(sas_offset_secs) * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< * # stata stores in milliseconds - * mulfac = 1000.0 + * mulfac = 1000 */ __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":79 + /* "pyreadstat/_readstat_writer.pyx":80 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds - * mulfac = 1000.0 # <<<<<<<<<<<<<< + * mulfac = 1000 # <<<<<<<<<<<<<< * convfacs = {'ns': 1e9, 'us': 1e6, 'ms': 1e3} * */ - __pyx_v_mulfac = 1000.0; + __pyx_v_mulfac = 0x3E8; - /* "pyreadstat/_readstat_writer.pyx":77 + /* "pyreadstat/_readstat_writer.pyx":78 * else: - * offset_secs = sas_offset_secs + * offset_secs = int(sas_offset_secs) * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< * # stata stores in milliseconds - * mulfac = 1000.0 + * mulfac = 1000 */ } - /* "pyreadstat/_readstat_writer.pyx":80 + /* "pyreadstat/_readstat_writer.pyx":81 * # stata stores in milliseconds - * mulfac = 1000.0 + * mulfac = 1000 * convfacs = {'ns': 1e9, 'us': 1e6, 'ms': 1e3} # <<<<<<<<<<<<<< * * col_indxs = list() */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ns, __pyx_mstate_global->__pyx_float_1e9) < (0)) __PYX_ERR(0, 80, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_us, __pyx_mstate_global->__pyx_float_1e6) < (0)) __PYX_ERR(0, 80, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ms, __pyx_mstate_global->__pyx_float_1e3) < (0)) __PYX_ERR(0, 80, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ns, __pyx_mstate_global->__pyx_float_1e9) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_us, __pyx_mstate_global->__pyx_float_1e6) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ms, __pyx_mstate_global->__pyx_float_1e3) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_v_convfacs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":82 + /* "pyreadstat/_readstat_writer.pyx":83 * convfacs = {'ns': 1e9, 'us': 1e6, 'ms': 1e3} * * col_indxs = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_col_indxs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":83 + /* "pyreadstat/_readstat_writer.pyx":84 * * col_indxs = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -3400,7 +3428,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_col_indx = __pyx_t_5; - /* "pyreadstat/_readstat_writer.pyx":84 + /* "pyreadstat/_readstat_writer.pyx":85 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -3409,32 +3437,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ if (unlikely(__pyx_v_pywriter_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 85, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":85 + /* "pyreadstat/_readstat_writer.pyx":86 * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: * col_indxs.append(col_indx) # <<<<<<<<<<<<<< * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) */ - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":84 + /* "pyreadstat/_readstat_writer.pyx":85 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -3444,7 +3472,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } } - /* "pyreadstat/_readstat_writer.pyx":87 + /* "pyreadstat/_readstat_writer.pyx":88 * col_indxs.append(col_indx) * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) # <<<<<<<<<<<<<< @@ -3454,9 +3482,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_6 = __pyx_v_df; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; @@ -3476,14 +3504,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 87, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; @@ -3493,7 +3521,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_14 = 0; @@ -3502,18 +3530,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":88 + /* "pyreadstat/_readstat_writer.pyx":89 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< * convfac = convfacs[pywriter_timeunits[col_indx]] - * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) + * whole = nw.nth(col_indx) // convfac + offset_secs */ __pyx_t_7 = __pyx_v_col_indxs; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0; @@ -3521,267 +3549,300 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 88, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 89, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_col_indx = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":89 + /* "pyreadstat/_readstat_writer.pyx":90 * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: * convfac = convfacs[pywriter_timeunits[col_indx]] # <<<<<<<<<<<<<< - * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) + * whole = nw.nth(col_indx) // convfac + offset_secs + * frac = nw.nth(col_indx) % convfac */ if (unlikely(__pyx_v_pywriter_timeunits == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 89, __pyx_L1_error) + __PYX_ERR(0, 90, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_timeunits, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_timeunits, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_convfacs, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_convfacs, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_16 = __Pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_convfac = __pyx_t_16; + __pyx_v_convfac = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":90 + /* "pyreadstat/_readstat_writer.pyx":91 * for col_indx in col_indxs: * convfac = convfacs[pywriter_timeunits[col_indx]] - * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) # <<<<<<<<<<<<<< - * df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) - * return df + * whole = nw.nth(col_indx) // convfac + offset_secs # <<<<<<<<<<<<<< + * frac = nw.nth(col_indx) % convfac + * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then( */ - __pyx_t_2 = __pyx_v_df; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_18 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_14 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_20))) { - __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_20); - assert(__pyx_t_18); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_20); - __Pyx_INCREF(__pyx_t_18); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_20, __pyx__function); - __pyx_t_14 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_19}; - __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_20, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - } - __pyx_t_20 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_17))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17); - assert(__pyx_t_13); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17); - __Pyx_INCREF(__pyx_t_13); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_17, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_14 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_20}; - __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_11 = __pyx_t_9; - __Pyx_INCREF(__pyx_t_11); - __pyx_t_20 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_convfac); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyNumber_FloorDivide(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyLong_From_PY_LONG_LONG(__pyx_v_offset_secs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF_SET(__pyx_v_whole, __pyx_t_6); + __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":92 + * convfac = convfacs[pywriter_timeunits[col_indx]] + * whole = nw.nth(col_indx) // convfac + offset_secs + * frac = nw.nth(col_indx) % convfac # <<<<<<<<<<<<<< + * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then( + * (whole.cast(nw.Float64) * mulfac + frac.cast(nw.Float64) / convfac * mulfac))) +*/ + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_20); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_20); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_14 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_13}; - __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - } - __pyx_t_14 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_17}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_then, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 90, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - } - __pyx_t_14 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } - __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); - __pyx_t_6 = 0; - - /* "pyreadstat/_readstat_writer.pyx":91 - * convfac = convfacs[pywriter_timeunits[col_indx]] - * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) # <<<<<<<<<<<<<< + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_convfac); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyNumber_Remainder(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_frac, __pyx_t_10); + __pyx_t_10 = 0; + + /* "pyreadstat/_readstat_writer.pyx":93 + * whole = nw.nth(col_indx) // convfac + offset_secs + * frac = nw.nth(col_indx) % convfac + * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then( # <<<<<<<<<<<<<< + * (whole.cast(nw.Float64) * mulfac + frac.cast(nw.Float64) / convfac * mulfac))) * return df - * */ - __pyx_t_10 = __pyx_v_df; - __Pyx_INCREF(__pyx_t_10); + __pyx_t_2 = __pyx_v_df; + __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_17 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_19))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_19); - assert(__pyx_t_13); + __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_19); + assert(__pyx_t_17); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19); - __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_19, __pyx__function); __pyx_t_14 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_20}; + PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_18}; __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_19, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_11 = __pyx_t_12; + __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_14 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_16))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_16); + assert(__pyx_t_13); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_16, __pyx__function); + __pyx_t_14 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_19}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + } + __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + + /* "pyreadstat/_readstat_writer.pyx":94 + * frac = nw.nth(col_indx) % convfac + * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then( + * (whole.cast(nw.Float64) * mulfac + frac.cast(nw.Float64) / convfac * mulfac))) # <<<<<<<<<<<<<< + * return df + * +*/ + __pyx_t_19 = __pyx_v_whole; + __Pyx_INCREF(__pyx_t_19); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_20}; - __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cast, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_12}; + __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cast, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); } - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_convfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_mulfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_t_17, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_secs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = PyNumber_Add(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_19 = PyNumber_Multiply(__pyx_t_16, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_9 = __pyx_t_17; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_16 = __pyx_v_frac; + __Pyx_INCREF(__pyx_t_16); + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_18}; + __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cast, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_17 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_2, __pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 91, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_convfac); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_mulfac); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_12 = PyNumber_Multiply(__pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; - __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_18}; + __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_then, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } - __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_14 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6}; + __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_10); + __pyx_t_10 = 0; - /* "pyreadstat/_readstat_writer.pyx":88 + /* "pyreadstat/_readstat_writer.pyx":89 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< * convfac = convfacs[pywriter_timeunits[col_indx]] - * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) + * whole = nw.nth(col_indx) // convfac + offset_secs */ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":92 - * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) + /* "pyreadstat/_readstat_writer.pyx":95 + * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then( + * (whole.cast(nw.Float64) * mulfac + frac.cast(nw.Float64) / convfac * mulfac))) * return df # <<<<<<<<<<<<<< * * @@ -3791,7 +3852,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_r = __pyx_v_df; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":62 + /* "pyreadstat/_readstat_writer.pyx":63 * cdef int dta_117_max_width = 2045 * * cdef object vectorized_convert_datetime_to_number(object df, dst_file_format file_format, list pywriter_types, list pywriter_timeunits, int col_count): # <<<<<<<<<<<<<< @@ -3809,22 +3870,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); - __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("pyreadstat._readstat_writer.vectorized_convert_datetime_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_convfacs); __Pyx_XDECREF(__pyx_v_col_indxs); + __Pyx_XDECREF(__pyx_v_whole); + __Pyx_XDECREF(__pyx_v_frac); __Pyx_XDECREF(__pyx_v_df); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":95 +/* "pyreadstat/_readstat_writer.pyx":98 * * * cdef object vectorized_convert_date_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -3864,7 +3927,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_RefNannySetupContext("vectorized_convert_date_to_number", 0); __Pyx_INCREF(__pyx_v_df); - /* "pyreadstat/_readstat_writer.pyx":100 + /* "pyreadstat/_readstat_writer.pyx":103 * """ * cdef double offset_days * cdef double mulfac = 1.0 # <<<<<<<<<<<<<< @@ -3873,7 +3936,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_mulfac = 1.0; - /* "pyreadstat/_readstat_writer.pyx":104 + /* "pyreadstat/_readstat_writer.pyx":107 * cdef list col_indxs * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -3884,7 +3947,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":105 + /* "pyreadstat/_readstat_writer.pyx":108 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_days = spss_offset_days # <<<<<<<<<<<<<< @@ -3893,7 +3956,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_offset_days = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days; - /* "pyreadstat/_readstat_writer.pyx":107 + /* "pyreadstat/_readstat_writer.pyx":110 * offset_days = spss_offset_days * # spss stores in seconds * mulfac = 86400 # <<<<<<<<<<<<<< @@ -3902,7 +3965,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_mulfac = 86400.0; - /* "pyreadstat/_readstat_writer.pyx":104 + /* "pyreadstat/_readstat_writer.pyx":107 * cdef list col_indxs * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -3912,7 +3975,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date break; default: - /* "pyreadstat/_readstat_writer.pyx":109 + /* "pyreadstat/_readstat_writer.pyx":112 * mulfac = 86400 * else: * offset_days = sas_offset_days # <<<<<<<<<<<<<< @@ -3923,19 +3986,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date break; } - /* "pyreadstat/_readstat_writer.pyx":110 + /* "pyreadstat/_readstat_writer.pyx":113 * else: * offset_days = sas_offset_days * col_indxs = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_indxs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":111 + /* "pyreadstat/_readstat_writer.pyx":114 * offset_days = sas_offset_days * col_indxs = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -3947,7 +4010,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_col_indx = __pyx_t_4; - /* "pyreadstat/_readstat_writer.pyx":112 + /* "pyreadstat/_readstat_writer.pyx":115 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -3956,32 +4019,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ if (unlikely(__pyx_v_pywriter_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 112, __pyx_L1_error) + __PYX_ERR(0, 115, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { - /* "pyreadstat/_readstat_writer.pyx":113 + /* "pyreadstat/_readstat_writer.pyx":116 * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: * col_indxs.append(col_indx) # <<<<<<<<<<<<<< * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) */ - __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":112 + /* "pyreadstat/_readstat_writer.pyx":115 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -3991,7 +4054,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } } - /* "pyreadstat/_readstat_writer.pyx":115 + /* "pyreadstat/_readstat_writer.pyx":118 * col_indxs.append(col_indx) * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) # <<<<<<<<<<<<<< @@ -4001,9 +4064,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_5 = __pyx_v_df; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; @@ -4023,14 +4086,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; @@ -4040,7 +4103,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_14 = 0; @@ -4049,13 +4112,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":116 + /* "pyreadstat/_readstat_writer.pyx":119 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -4068,19 +4131,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 119, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_col_indx = __pyx_t_2; - /* "pyreadstat/_readstat_writer.pyx":117 + /* "pyreadstat/_readstat_writer.pyx":120 * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) # <<<<<<<<<<<<<< @@ -4090,18 +4153,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_5 = __pyx_v_df; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_17 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4121,10 +4184,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4144,18 +4207,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_19 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4175,7 +4238,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } __pyx_t_14 = 0; @@ -4185,7 +4248,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_14 = 0; @@ -4194,13 +4257,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":118 + /* "pyreadstat/_readstat_writer.pyx":121 * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64) + offset_days).round() * mulfac) # <<<<<<<<<<<<<< @@ -4210,12 +4273,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __pyx_v_df; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4235,14 +4298,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_14 = 0; @@ -4252,12 +4315,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_days); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_days); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_19 = PyNumber_Add(__pyx_t_16, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_16, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -4269,12 +4332,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_19 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_19); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_19); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; @@ -4284,13 +4347,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":116 + /* "pyreadstat/_readstat_writer.pyx":119 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -4300,7 +4363,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":119 + /* "pyreadstat/_readstat_writer.pyx":122 * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64) + offset_days).round() * mulfac) * return df # <<<<<<<<<<<<<< @@ -4312,7 +4375,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_r = __pyx_v_df; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":95 + /* "pyreadstat/_readstat_writer.pyx":98 * * * cdef object vectorized_convert_date_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -4344,7 +4407,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":121 +/* "pyreadstat/_readstat_writer.pyx":124 * return df * * cdef object vectorized_convert_time_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -4383,7 +4446,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_RefNannySetupContext("vectorized_convert_time_to_number", 0); __Pyx_INCREF(__pyx_v_df); - /* "pyreadstat/_readstat_writer.pyx":125 + /* "pyreadstat/_readstat_writer.pyx":128 * transforms time64 columns in the dataframe to floats * """ * cdef double mulfac = 1.0 # <<<<<<<<<<<<<< @@ -4392,7 +4455,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ __pyx_v_mulfac = 1.0; - /* "pyreadstat/_readstat_writer.pyx":129 + /* "pyreadstat/_readstat_writer.pyx":132 * cdef list col_indxs * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -4402,7 +4465,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":131 + /* "pyreadstat/_readstat_writer.pyx":134 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * mulfac = 1000.0 # <<<<<<<<<<<<<< @@ -4411,7 +4474,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ __pyx_v_mulfac = 1000.0; - /* "pyreadstat/_readstat_writer.pyx":129 + /* "pyreadstat/_readstat_writer.pyx":132 * cdef list col_indxs * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -4420,19 +4483,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ } - /* "pyreadstat/_readstat_writer.pyx":133 + /* "pyreadstat/_readstat_writer.pyx":136 * mulfac = 1000.0 * * col_indxs = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_col_indxs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":134 + /* "pyreadstat/_readstat_writer.pyx":137 * * col_indxs = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -4444,7 +4507,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_col_indx = __pyx_t_5; - /* "pyreadstat/_readstat_writer.pyx":135 + /* "pyreadstat/_readstat_writer.pyx":138 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -4453,32 +4516,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ if (unlikely(__pyx_v_pywriter_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 135, __pyx_L1_error) + __PYX_ERR(0, 138, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":136 + /* "pyreadstat/_readstat_writer.pyx":139 * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: * col_indxs.append(col_indx) # <<<<<<<<<<<<<< * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) */ - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":135 + /* "pyreadstat/_readstat_writer.pyx":138 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -4488,7 +4551,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time } } - /* "pyreadstat/_readstat_writer.pyx":138 + /* "pyreadstat/_readstat_writer.pyx":141 * col_indxs.append(col_indx) * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) # <<<<<<<<<<<<<< @@ -4498,9 +4561,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_6 = __pyx_v_df; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; @@ -4520,14 +4583,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; @@ -4537,7 +4600,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_14 = 0; @@ -4546,18 +4609,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":139 + /* "pyreadstat/_readstat_writer.pyx":142 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) + * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round(9) * mulfac) */ __pyx_t_7 = __pyx_v_col_indxs; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0; @@ -4565,40 +4628,40 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 142, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_col_indx = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":140 + /* "pyreadstat/_readstat_writer.pyx":143 * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) # <<<<<<<<<<<<<< - * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) + * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round(9) * mulfac) * return df */ __pyx_t_6 = __pyx_v_df; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_17 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4618,10 +4681,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4641,18 +4704,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_19 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4672,7 +4735,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } __pyx_t_14 = 0; @@ -4682,7 +4745,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_14 = 0; @@ -4691,28 +4754,28 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":141 + /* "pyreadstat/_readstat_writer.pyx":144 * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) # <<<<<<<<<<<<<< + * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round(9) * mulfac) # <<<<<<<<<<<<<< * return df * */ __pyx_t_10 = __pyx_v_df; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4732,14 +4795,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_14 = 0; @@ -4749,26 +4812,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } - __pyx_t_12 = __Pyx_PyFloat_DivideObjC(__pyx_t_16, __pyx_mstate_global->__pyx_float_1e9, 1e9, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyFloat_DivideObjC(__pyx_t_16, __pyx_mstate_global->__pyx_float_1e9, 1e9, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_9 = __pyx_t_12; __Pyx_INCREF(__pyx_t_9); __pyx_t_14 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_int_9}; + __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -4778,25 +4841,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":139 + /* "pyreadstat/_readstat_writer.pyx":142 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) + * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round(9) * mulfac) */ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":142 + /* "pyreadstat/_readstat_writer.pyx":145 * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) + * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round(9) * mulfac) * return df # <<<<<<<<<<<<<< * * cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: @@ -4806,7 +4869,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_r = __pyx_v_df; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":121 + /* "pyreadstat/_readstat_writer.pyx":124 * return df * * cdef object vectorized_convert_time_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -4838,7 +4901,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":144 +/* "pyreadstat/_readstat_writer.pyx":147 * return df * * cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: # <<<<<<<<<<<<<< @@ -4868,8 +4931,17 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_datetimelike_to_number", 0); - /* "pyreadstat/_readstat_writer.pyx":151 - * cdef double offset_days, tstamp + /* "pyreadstat/_readstat_writer.pyx":153 + * + * cdef double offset_days + * cdef double tstamp = 0 # <<<<<<<<<<<<<< + * + * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: +*/ + __pyx_v_tstamp = 0.0; + + /* "pyreadstat/_readstat_writer.pyx":155 + * cdef double tstamp = 0 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< * offset_days = spss_offset_days @@ -4879,7 +4951,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":152 + /* "pyreadstat/_readstat_writer.pyx":156 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_days = spss_offset_days # <<<<<<<<<<<<<< @@ -4888,7 +4960,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_offset_days = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days; - /* "pyreadstat/_readstat_writer.pyx":153 + /* "pyreadstat/_readstat_writer.pyx":157 * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_days = spss_offset_days * offset_secs = spss_offset_secs # <<<<<<<<<<<<<< @@ -4897,8 +4969,8 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_offset_secs = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs; - /* "pyreadstat/_readstat_writer.pyx":151 - * cdef double offset_days, tstamp + /* "pyreadstat/_readstat_writer.pyx":155 + * cdef double tstamp = 0 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< * offset_days = spss_offset_days @@ -4907,7 +4979,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; default: - /* "pyreadstat/_readstat_writer.pyx":155 + /* "pyreadstat/_readstat_writer.pyx":159 * offset_secs = spss_offset_secs * else: * offset_days = sas_offset_days # <<<<<<<<<<<<<< @@ -4916,7 +4988,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_offset_days = __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_days; - /* "pyreadstat/_readstat_writer.pyx":156 + /* "pyreadstat/_readstat_writer.pyx":160 * else: * offset_days = sas_offset_days * offset_secs = sas_offset_secs # <<<<<<<<<<<<<< @@ -4927,7 +4999,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; } - /* "pyreadstat/_readstat_writer.pyx":158 + /* "pyreadstat/_readstat_writer.pyx":162 * offset_secs = sas_offset_secs * * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -4938,25 +5010,25 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64: - /* "pyreadstat/_readstat_writer.pyx":160 + /* "pyreadstat/_readstat_writer.pyx":164 * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * # get timestamp in seconds * if type(curval) == datetime.datetime: # <<<<<<<<<<<<<< * tstamp = curval.replace(tzinfo=timezone.utc).timestamp() # works only in python 3 * #tstamp = calendar.timegm(curval.replace(tzinfo=_timezone.utc).timetuple()) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":161 + /* "pyreadstat/_readstat_writer.pyx":165 * # get timestamp in seconds * if type(curval) == datetime.datetime: * tstamp = curval.replace(tzinfo=timezone.utc).timestamp() # works only in python 3 # <<<<<<<<<<<<<< @@ -4965,22 +5037,22 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_t_5 = __pyx_v_curval; __Pyx_INCREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL}; - __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_7, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 161, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_7, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_replace, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __pyx_t_4; @@ -4991,14 +5063,14 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_timestamp, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tstamp = __pyx_t_9; - /* "pyreadstat/_readstat_writer.pyx":160 + /* "pyreadstat/_readstat_writer.pyx":164 * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * # get timestamp in seconds * if type(curval) == datetime.datetime: # <<<<<<<<<<<<<< @@ -5007,7 +5079,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":164 + /* "pyreadstat/_readstat_writer.pyx":168 * #tstamp = calendar.timegm(curval.replace(tzinfo=_timezone.utc).timetuple()) * * tstamp += offset_secs # <<<<<<<<<<<<<< @@ -5016,7 +5088,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp + __pyx_v_offset_secs); - /* "pyreadstat/_readstat_writer.pyx":165 + /* "pyreadstat/_readstat_writer.pyx":169 * * tstamp += offset_secs * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5026,7 +5098,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_t_3 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":167 + /* "pyreadstat/_readstat_writer.pyx":171 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * tstamp *= 1000 # <<<<<<<<<<<<<< @@ -5035,7 +5107,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp * 1000.0); - /* "pyreadstat/_readstat_writer.pyx":165 + /* "pyreadstat/_readstat_writer.pyx":169 * * tstamp += offset_secs * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5044,7 +5116,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":158 + /* "pyreadstat/_readstat_writer.pyx":162 * offset_secs = sas_offset_secs * * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -5054,50 +5126,50 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: - /* "pyreadstat/_readstat_writer.pyx":170 + /* "pyreadstat/_readstat_writer.pyx":174 * * elif curtype == PYWRITER_DATE: * if type(curval) == datetime.date: # <<<<<<<<<<<<<< * days = curval - date_0 * tstamp = days.days */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":171 + /* "pyreadstat/_readstat_writer.pyx":175 * elif curtype == PYWRITER_DATE: * if type(curval) == datetime.date: * days = curval - date_0 # <<<<<<<<<<<<<< * tstamp = days.days * tstamp += offset_days */ - __pyx_t_1 = PyNumber_Subtract(__pyx_v_curval, __pyx_v_10pyreadstat_16_readstat_writer_date_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_curval, __pyx_v_10pyreadstat_16_readstat_writer_date_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_days = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":172 + /* "pyreadstat/_readstat_writer.pyx":176 * if type(curval) == datetime.date: * days = curval - date_0 * tstamp = days.days # <<<<<<<<<<<<<< * tstamp += offset_days * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_days, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_days, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tstamp = __pyx_t_9; - /* "pyreadstat/_readstat_writer.pyx":173 + /* "pyreadstat/_readstat_writer.pyx":177 * days = curval - date_0 * tstamp = days.days * tstamp += offset_days # <<<<<<<<<<<<<< @@ -5106,7 +5178,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp + __pyx_v_offset_days); - /* "pyreadstat/_readstat_writer.pyx":174 + /* "pyreadstat/_readstat_writer.pyx":178 * tstamp = days.days * tstamp += offset_days * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -5117,7 +5189,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":176 + /* "pyreadstat/_readstat_writer.pyx":180 * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * # spss stores in seconds * tstamp *= 86400 # <<<<<<<<<<<<<< @@ -5126,7 +5198,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp * 86400.0); - /* "pyreadstat/_readstat_writer.pyx":174 + /* "pyreadstat/_readstat_writer.pyx":178 * tstamp = days.days * tstamp += offset_days * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -5137,7 +5209,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu default: break; } - /* "pyreadstat/_readstat_writer.pyx":170 + /* "pyreadstat/_readstat_writer.pyx":174 * * elif curtype == PYWRITER_DATE: * if type(curval) == datetime.date: # <<<<<<<<<<<<<< @@ -5146,7 +5218,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":169 + /* "pyreadstat/_readstat_writer.pyx":173 * tstamp *= 1000 * * elif curtype == PYWRITER_DATE: # <<<<<<<<<<<<<< @@ -5156,44 +5228,44 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME: - /* "pyreadstat/_readstat_writer.pyx":179 + /* "pyreadstat/_readstat_writer.pyx":183 * * elif curtype == PYWRITER_TIME: * if type(curval) == datetime.time: # <<<<<<<<<<<<<< * tdelta = datetime.datetime.combine(datetime.date.min, curval) - datetime.datetime.min * tstamp = tdelta.total_seconds() */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":180 + /* "pyreadstat/_readstat_writer.pyx":184 * elif curtype == PYWRITER_TIME: * if type(curval) == datetime.time: * tdelta = datetime.datetime.combine(datetime.date.min, curval) - datetime.datetime.min # <<<<<<<<<<<<<< * tstamp = tdelta.total_seconds() * #tstamp += offset * 86400 */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; @@ -5203,25 +5275,25 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":181 + /* "pyreadstat/_readstat_writer.pyx":185 * if type(curval) == datetime.time: * tdelta = datetime.datetime.combine(datetime.date.min, curval) - datetime.datetime.min * tstamp = tdelta.total_seconds() # <<<<<<<<<<<<<< @@ -5235,14 +5307,14 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_total_seconds, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tstamp = __pyx_t_9; - /* "pyreadstat/_readstat_writer.pyx":183 + /* "pyreadstat/_readstat_writer.pyx":187 * tstamp = tdelta.total_seconds() * #tstamp += offset * 86400 * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5252,7 +5324,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_t_3 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":185 + /* "pyreadstat/_readstat_writer.pyx":189 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * tstamp *= 1000 # <<<<<<<<<<<<<< @@ -5261,7 +5333,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp * 1000.0); - /* "pyreadstat/_readstat_writer.pyx":183 + /* "pyreadstat/_readstat_writer.pyx":187 * tstamp = tdelta.total_seconds() * #tstamp += offset * 86400 * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5270,7 +5342,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":179 + /* "pyreadstat/_readstat_writer.pyx":183 * * elif curtype == PYWRITER_TIME: * if type(curval) == datetime.time: # <<<<<<<<<<<<<< @@ -5279,7 +5351,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":178 + /* "pyreadstat/_readstat_writer.pyx":182 * tstamp *= 86400 * * elif curtype == PYWRITER_TIME: # <<<<<<<<<<<<<< @@ -5290,7 +5362,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu default: break; } - /* "pyreadstat/_readstat_writer.pyx":187 + /* "pyreadstat/_readstat_writer.pyx":191 * tstamp *= 1000 * * return tstamp # <<<<<<<<<<<<<< @@ -5300,7 +5372,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_r = __pyx_v_tstamp; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":144 + /* "pyreadstat/_readstat_writer.pyx":147 * return df * * cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: # <<<<<<<<<<<<<< @@ -5325,7 +5397,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":189 +/* "pyreadstat/_readstat_writer.pyx":193 * return tstamp * * cdef char * get_datetimelike_format_for_readstat(dst_file_format file_format, pywriter_variable_type curtype): # <<<<<<<<<<<<<< @@ -5346,7 +5418,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_datetimelike_format_for_readstat", 0); - /* "pyreadstat/_readstat_writer.pyx":194 + /* "pyreadstat/_readstat_writer.pyx":198 * """ * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -5357,7 +5429,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64: - /* "pyreadstat/_readstat_writer.pyx":195 + /* "pyreadstat/_readstat_writer.pyx":199 * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5367,7 +5439,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":196 + /* "pyreadstat/_readstat_writer.pyx":200 * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: * if file_format == FILE_FORMAT_DTA: * return "%td" # <<<<<<<<<<<<<< @@ -5377,7 +5449,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_r = ((char *)"%td"); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":195 + /* "pyreadstat/_readstat_writer.pyx":199 * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5386,7 +5458,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ } - /* "pyreadstat/_readstat_writer.pyx":200 + /* "pyreadstat/_readstat_writer.pyx":204 * # return "DATE11" * else: * return "DATE" # <<<<<<<<<<<<<< @@ -5398,7 +5470,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":194 + /* "pyreadstat/_readstat_writer.pyx":198 * """ * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -5408,7 +5480,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME: - /* "pyreadstat/_readstat_writer.pyx":201 + /* "pyreadstat/_readstat_writer.pyx":205 * else: * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -5417,7 +5489,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64: - /* "pyreadstat/_readstat_writer.pyx":202 + /* "pyreadstat/_readstat_writer.pyx":206 * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5427,7 +5499,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":203 + /* "pyreadstat/_readstat_writer.pyx":207 * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * if file_format == FILE_FORMAT_DTA: * return "%tc" # <<<<<<<<<<<<<< @@ -5437,7 +5509,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_r = ((char *)"%tc"); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":202 + /* "pyreadstat/_readstat_writer.pyx":206 * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5446,7 +5518,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ } - /* "pyreadstat/_readstat_writer.pyx":207 + /* "pyreadstat/_readstat_writer.pyx":211 * # return "DATETIME20" * else: * return "DATETIME" # <<<<<<<<<<<<<< @@ -5458,7 +5530,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":201 + /* "pyreadstat/_readstat_writer.pyx":205 * else: * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -5468,7 +5540,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME: - /* "pyreadstat/_readstat_writer.pyx":208 + /* "pyreadstat/_readstat_writer.pyx":212 * else: * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -5477,7 +5549,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64: - /* "pyreadstat/_readstat_writer.pyx":209 + /* "pyreadstat/_readstat_writer.pyx":213 * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5487,7 +5559,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":210 + /* "pyreadstat/_readstat_writer.pyx":214 * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: * if file_format == FILE_FORMAT_DTA: * return "%tcHH:MM:SS" # <<<<<<<<<<<<<< @@ -5497,7 +5569,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_r = ((char *)"%tcHH:MM:SS"); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":209 + /* "pyreadstat/_readstat_writer.pyx":213 * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5506,7 +5578,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ } - /* "pyreadstat/_readstat_writer.pyx":212 + /* "pyreadstat/_readstat_writer.pyx":216 * return "%tcHH:MM:SS" * else: * return "TIME" # <<<<<<<<<<<<<< @@ -5518,7 +5590,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":208 + /* "pyreadstat/_readstat_writer.pyx":212 * else: * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -5528,7 +5600,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for break; default: - /* "pyreadstat/_readstat_writer.pyx":214 + /* "pyreadstat/_readstat_writer.pyx":218 * return "TIME" * else: * raise PyreadstatError("Unknown pywriter variable format") # <<<<<<<<<<<<<< @@ -5536,7 +5608,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for * cdef int get_narwhals_str_series_max_length(object series, dict value_labels, bint isobject): */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -5555,16 +5627,16 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 214, __pyx_L1_error) + __PYX_ERR(0, 218, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_writer.pyx":189 + /* "pyreadstat/_readstat_writer.pyx":193 * return tstamp * * cdef char * get_datetimelike_format_for_readstat(dst_file_format file_format, pywriter_variable_type curtype): # <<<<<<<<<<<<<< @@ -5584,7 +5656,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":216 +/* "pyreadstat/_readstat_writer.pyx":220 * raise PyreadstatError("Unknown pywriter variable format") * * cdef int get_narwhals_str_series_max_length(object series, dict value_labels, bint isobject): # <<<<<<<<<<<<<< @@ -5614,7 +5686,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_narwhals_str_series_max_length", 0); - /* "pyreadstat/_readstat_writer.pyx":221 + /* "pyreadstat/_readstat_writer.pyx":225 * cdef object val * cdef bytes temp * cdef int max_length = 1 # <<<<<<<<<<<<<< @@ -5623,7 +5695,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ __pyx_v_max_length = 1; - /* "pyreadstat/_readstat_writer.pyx":224 + /* "pyreadstat/_readstat_writer.pyx":228 * cdef int curlen * cdef list labels * for val in series: # <<<<<<<<<<<<<< @@ -5635,9 +5707,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5645,7 +5717,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5655,7 +5727,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5666,13 +5738,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 228, __pyx_L1_error) PyErr_Clear(); } break; @@ -5682,7 +5754,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":225 + /* "pyreadstat/_readstat_writer.pyx":229 * cdef list labels * for val in series: * if isobject: # <<<<<<<<<<<<<< @@ -5691,19 +5763,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ if (__pyx_v_isobject) { - /* "pyreadstat/_readstat_writer.pyx":226 + /* "pyreadstat/_readstat_writer.pyx":230 * for val in series: * if isobject: * val = str(val) # <<<<<<<<<<<<<< * temp = val.encode("utf-8") * curlen = len(temp) */ - __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":225 + /* "pyreadstat/_readstat_writer.pyx":229 * cdef list labels * for val in series: * if isobject: # <<<<<<<<<<<<<< @@ -5712,7 +5784,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":227 + /* "pyreadstat/_readstat_writer.pyx":231 * if isobject: * val = str(val) * temp = val.encode("utf-8") # <<<<<<<<<<<<<< @@ -5726,14 +5798,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 227, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_temp, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":228 + /* "pyreadstat/_readstat_writer.pyx":232 * val = str(val) * temp = val.encode("utf-8") * curlen = len(temp) # <<<<<<<<<<<<<< @@ -5742,12 +5814,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ if (unlikely(__pyx_v_temp == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 228, __pyx_L1_error) + __PYX_ERR(0, 232, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_v_temp); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_v_temp); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_v_curlen = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":229 + /* "pyreadstat/_readstat_writer.pyx":233 * temp = val.encode("utf-8") * curlen = len(temp) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5757,7 +5829,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_t_8 = (__pyx_v_curlen > __pyx_v_max_length); if (__pyx_t_8) { - /* "pyreadstat/_readstat_writer.pyx":230 + /* "pyreadstat/_readstat_writer.pyx":234 * curlen = len(temp) * if curlen > max_length: * max_length = curlen # <<<<<<<<<<<<<< @@ -5766,7 +5838,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ __pyx_v_max_length = __pyx_v_curlen; - /* "pyreadstat/_readstat_writer.pyx":229 + /* "pyreadstat/_readstat_writer.pyx":233 * temp = val.encode("utf-8") * curlen = len(temp) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5775,7 +5847,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":224 + /* "pyreadstat/_readstat_writer.pyx":228 * cdef int curlen * cdef list labels * for val in series: # <<<<<<<<<<<<<< @@ -5785,17 +5857,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":231 + /* "pyreadstat/_readstat_writer.pyx":235 * if curlen > max_length: * max_length = curlen * if value_labels: # <<<<<<<<<<<<<< * labels = list(value_labels.keys()) * for lab in labels: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) if (__pyx_t_8) { - /* "pyreadstat/_readstat_writer.pyx":232 + /* "pyreadstat/_readstat_writer.pyx":236 * max_length = curlen * if value_labels: * labels = list(value_labels.keys()) # <<<<<<<<<<<<<< @@ -5804,17 +5876,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ if (unlikely(__pyx_v_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 236, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_value_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_value_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_labels = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":233 + /* "pyreadstat/_readstat_writer.pyx":237 * if value_labels: * labels = list(value_labels.keys()) * for lab in labels: # <<<<<<<<<<<<<< @@ -5827,31 +5899,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 237, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_lab, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":234 + /* "pyreadstat/_readstat_writer.pyx":238 * labels = list(value_labels.keys()) * for lab in labels: * curlen = len(str(lab)) # <<<<<<<<<<<<<< * if curlen > max_length: * max_length = curlen */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_lab); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_lab); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_curlen = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":235 + /* "pyreadstat/_readstat_writer.pyx":239 * for lab in labels: * curlen = len(str(lab)) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5861,7 +5933,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_t_8 = (__pyx_v_curlen > __pyx_v_max_length); if (__pyx_t_8) { - /* "pyreadstat/_readstat_writer.pyx":236 + /* "pyreadstat/_readstat_writer.pyx":240 * curlen = len(str(lab)) * if curlen > max_length: * max_length = curlen # <<<<<<<<<<<<<< @@ -5870,7 +5942,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ __pyx_v_max_length = __pyx_v_curlen; - /* "pyreadstat/_readstat_writer.pyx":235 + /* "pyreadstat/_readstat_writer.pyx":239 * for lab in labels: * curlen = len(str(lab)) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5879,7 +5951,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":233 + /* "pyreadstat/_readstat_writer.pyx":237 * if value_labels: * labels = list(value_labels.keys()) * for lab in labels: # <<<<<<<<<<<<<< @@ -5889,7 +5961,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":231 + /* "pyreadstat/_readstat_writer.pyx":235 * if curlen > max_length: * max_length = curlen * if value_labels: # <<<<<<<<<<<<<< @@ -5898,7 +5970,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":238 + /* "pyreadstat/_readstat_writer.pyx":242 * max_length = curlen * * return max_length # <<<<<<<<<<<<<< @@ -5908,7 +5980,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_r = __pyx_v_max_length; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":216 + /* "pyreadstat/_readstat_writer.pyx":220 * raise PyreadstatError("Unknown pywriter variable format") * * cdef int get_narwhals_str_series_max_length(object series, dict value_labels, bint isobject): # <<<<<<<<<<<<<< @@ -5932,7 +6004,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":241 +/* "pyreadstat/_readstat_writer.pyx":245 * * * cdef int check_series_all_same_types(object series, object type_to_check): # <<<<<<<<<<<<<< @@ -5954,7 +6026,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_series_all_same_types", 0); - /* "pyreadstat/_readstat_writer.pyx":245 + /* "pyreadstat/_readstat_writer.pyx":249 * 1 if all elements in a series are of type type_to_check, 0 otherwise * """ * for val in series: # <<<<<<<<<<<<<< @@ -5966,9 +6038,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5976,7 +6048,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 249, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5986,7 +6058,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 249, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5997,13 +6069,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 249, __pyx_L1_error) PyErr_Clear(); } break; @@ -6013,19 +6085,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":246 + /* "pyreadstat/_readstat_writer.pyx":250 * """ * for val in series: * if type(val) != type_to_check: # <<<<<<<<<<<<<< * return 0 * return 1 */ - __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), __pyx_v_type_to_check, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), __pyx_v_type_to_check, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "pyreadstat/_readstat_writer.pyx":247 + /* "pyreadstat/_readstat_writer.pyx":251 * for val in series: * if type(val) != type_to_check: * return 0 # <<<<<<<<<<<<<< @@ -6036,7 +6108,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":246 + /* "pyreadstat/_readstat_writer.pyx":250 * """ * for val in series: * if type(val) != type_to_check: # <<<<<<<<<<<<<< @@ -6045,7 +6117,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P */ } - /* "pyreadstat/_readstat_writer.pyx":245 + /* "pyreadstat/_readstat_writer.pyx":249 * 1 if all elements in a series are of type type_to_check, 0 otherwise * """ * for val in series: # <<<<<<<<<<<<<< @@ -6055,7 +6127,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":248 + /* "pyreadstat/_readstat_writer.pyx":252 * if type(val) != type_to_check: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -6065,7 +6137,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __pyx_r = 1; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":241 + /* "pyreadstat/_readstat_writer.pyx":245 * * * cdef int check_series_all_same_types(object series, object type_to_check): # <<<<<<<<<<<<<< @@ -6085,7 +6157,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":250 +/* "pyreadstat/_readstat_writer.pyx":254 * return 1 * * cdef list get_narwhals_column_types(object df, dict missing_user_values, dict variable_value_labels, int dta_str_max_len): # <<<<<<<<<<<<<< @@ -6128,19 +6200,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_RefNannySetupContext("get_narwhals_column_types", 0); __Pyx_INCREF(__pyx_v_variable_value_labels); - /* "pyreadstat/_readstat_writer.pyx":261 + /* "pyreadstat/_readstat_writer.pyx":265 * cdef int max_length, isobject * cdef bint has_missing * cdef list result = list() # <<<<<<<<<<<<<< * cdef int equal, is_missing * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":264 + /* "pyreadstat/_readstat_writer.pyx":268 * cdef int equal, is_missing * * if variable_value_labels is None: # <<<<<<<<<<<<<< @@ -6150,19 +6222,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (__pyx_v_variable_value_labels == ((PyObject*)Py_None)); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":265 + /* "pyreadstat/_readstat_writer.pyx":269 * * if variable_value_labels is None: * variable_value_labels = dict() # <<<<<<<<<<<<<< * * for curseries in df.iter_columns(): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_variable_value_labels, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":264 + /* "pyreadstat/_readstat_writer.pyx":268 * cdef int equal, is_missing * * if variable_value_labels is None: # <<<<<<<<<<<<<< @@ -6171,7 +6243,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":267 + /* "pyreadstat/_readstat_writer.pyx":271 * variable_value_labels = dict() * * for curseries in df.iter_columns(): # <<<<<<<<<<<<<< @@ -6185,7 +6257,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_iter_columns, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -6193,9 +6265,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -6204,7 +6276,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -6214,7 +6286,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -6225,13 +6297,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 271, __pyx_L1_error) PyErr_Clear(); } break; @@ -6241,56 +6313,56 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_XDECREF_SET(__pyx_v_curseries, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":268 + /* "pyreadstat/_readstat_writer.pyx":272 * * for curseries in df.iter_columns(): * col_name = curseries.name # <<<<<<<<<<<<<< * col_type = curseries.dtype * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":269 + /* "pyreadstat/_readstat_writer.pyx":273 * for curseries in df.iter_columns(): * col_name = curseries.name * col_type = curseries.dtype # <<<<<<<<<<<<<< * * # if categorical, let's use the type of the categories */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_col_type, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":272 + /* "pyreadstat/_readstat_writer.pyx":276 * * # if categorical, let's use the type of the categories * if col_type == nw.Categorical: # <<<<<<<<<<<<<< * col_type = curseries.cat.get_categories().dtype * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Categorical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Categorical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":273 + /* "pyreadstat/_readstat_writer.pyx":277 * # if categorical, let's use the type of the categories * if col_type == nw.Categorical: * col_type = curseries.cat.get_categories().dtype # <<<<<<<<<<<<<< * * # we need to remove nulls for series inspection */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_cat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_cat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); @@ -6300,16 +6372,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_categories, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_col_type, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":272 + /* "pyreadstat/_readstat_writer.pyx":276 * * # if categorical, let's use the type of the categories * if col_type == nw.Categorical: # <<<<<<<<<<<<<< @@ -6318,7 +6390,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":276 + /* "pyreadstat/_readstat_writer.pyx":280 * * # we need to remove nulls for series inspection * has_missing = curseries.null_count()>0 # <<<<<<<<<<<<<< @@ -6332,14 +6404,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_null_count, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_has_missing = (__pyx_t_2 > 0); - /* "pyreadstat/_readstat_writer.pyx":277 + /* "pyreadstat/_readstat_writer.pyx":281 * # we need to remove nulls for series inspection * has_missing = curseries.null_count()>0 * if has_missing: # <<<<<<<<<<<<<< @@ -6348,7 +6420,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (__pyx_v_has_missing) { - /* "pyreadstat/_readstat_writer.pyx":278 + /* "pyreadstat/_readstat_writer.pyx":282 * has_missing = curseries.null_count()>0 * if has_missing: * curseries = curseries.drop_nulls() # <<<<<<<<<<<<<< @@ -6362,13 +6434,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_drop_nulls, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_curseries, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":277 + /* "pyreadstat/_readstat_writer.pyx":281 * # we need to remove nulls for series inspection * has_missing = curseries.null_count()>0 * if has_missing: # <<<<<<<<<<<<<< @@ -6377,7 +6449,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":285 + /* "pyreadstat/_readstat_writer.pyx":289 * # missing values and missing_user_values. * # we need to take out those before inspecting the object series futher * curuser_missing = None # <<<<<<<<<<<<<< @@ -6387,17 +6459,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":286 + /* "pyreadstat/_readstat_writer.pyx":290 * # we need to take out those before inspecting the object series futher * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":287 + /* "pyreadstat/_readstat_writer.pyx":291 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(col_name) # <<<<<<<<<<<<<< @@ -6406,14 +6478,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 287, __pyx_L1_error) + __PYX_ERR(0, 291, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":286 + /* "pyreadstat/_readstat_writer.pyx":290 * # we need to take out those before inspecting the object series futher * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -6422,24 +6494,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":288 + /* "pyreadstat/_readstat_writer.pyx":292 * if missing_user_values: * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: # <<<<<<<<<<<<<< * if not df.implementation.is_pandas() and col_type == nw.Object: * curseries = [x for x in curseries if x not in curuser_missing] */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":289 + /* "pyreadstat/_readstat_writer.pyx":293 * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: * if not df.implementation.is_pandas() and col_type == nw.Object: # <<<<<<<<<<<<<< * curseries = [x for x in curseries if x not in curuser_missing] * else: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); @@ -6449,10 +6521,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_pandas, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (!__pyx_t_9); if (__pyx_t_10) { @@ -6460,36 +6532,36 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = __pyx_t_10; goto __pyx_L11_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L11_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":290 + /* "pyreadstat/_readstat_writer.pyx":294 * if curuser_missing: * if not df.implementation.is_pandas() and col_type == nw.Object: * curseries = [x for x in curseries if x not in curuser_missing] # <<<<<<<<<<<<<< * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_v_curseries)) || PyTuple_CheckExact(__pyx_v_curseries)) { __pyx_t_7 = __pyx_v_curseries; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_curseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_curseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 294, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -6497,7 +6569,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 294, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -6507,7 +6579,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 294, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -6518,13 +6590,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 294, __pyx_L1_error) PyErr_Clear(); } break; @@ -6533,16 +6605,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_x, __pyx_v_curuser_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_x, __pyx_v_curuser_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 294, __pyx_L1_error) if (__pyx_t_2) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 294, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_curseries, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":289 + /* "pyreadstat/_readstat_writer.pyx":293 * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: * if not df.implementation.is_pandas() and col_type == nw.Object: # <<<<<<<<<<<<<< @@ -6552,7 +6624,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L10; } - /* "pyreadstat/_readstat_writer.pyx":292 + /* "pyreadstat/_readstat_writer.pyx":296 * curseries = [x for x in curseries if x not in curuser_missing] * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) # <<<<<<<<<<<<<< @@ -6569,10 +6641,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_curuser_missing}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_in, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_13 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_13 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = 0; @@ -6581,7 +6653,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_filter, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_curseries, __pyx_t_8); @@ -6589,44 +6661,44 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } __pyx_L10:; - /* "pyreadstat/_readstat_writer.pyx":293 + /* "pyreadstat/_readstat_writer.pyx":297 * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) * if not len(curseries): # <<<<<<<<<<<<<< * result.append((PYWRITER_DOUBLE, 0, 1, None)) * continue */ - __pyx_t_11 = PyObject_Length(__pyx_v_curseries); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_v_curseries); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_t_2 = (!(__pyx_t_11 != 0)); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":294 + /* "pyreadstat/_readstat_writer.pyx":298 * curseries = curseries.filter(~curseries.is_in(curuser_missing)) * if not len(curseries): * result.append((PYWRITER_DOUBLE, 0, 1, None)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 298, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 298, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 298, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 298, __pyx_L1_error); __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":295 + /* "pyreadstat/_readstat_writer.pyx":299 * if not len(curseries): * result.append((PYWRITER_DOUBLE, 0, 1, None)) * continue # <<<<<<<<<<<<<< @@ -6635,7 +6707,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":293 + /* "pyreadstat/_readstat_writer.pyx":297 * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) * if not len(curseries): # <<<<<<<<<<<<<< @@ -6644,7 +6716,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":288 + /* "pyreadstat/_readstat_writer.pyx":292 * if missing_user_values: * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: # <<<<<<<<<<<<<< @@ -6653,7 +6725,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":297 + /* "pyreadstat/_readstat_writer.pyx":301 * continue * * max_length = 0 # <<<<<<<<<<<<<< @@ -6662,7 +6734,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_max_length = 0; - /* "pyreadstat/_readstat_writer.pyx":298 + /* "pyreadstat/_readstat_writer.pyx":302 * * max_length = 0 * curtype = None # <<<<<<<<<<<<<< @@ -6672,7 +6744,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curtype, ((PyTypeObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":299 + /* "pyreadstat/_readstat_writer.pyx":303 * max_length = 0 * curtype = None * equal = True # <<<<<<<<<<<<<< @@ -6681,64 +6753,64 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_equal = 1; - /* "pyreadstat/_readstat_writer.pyx":301 + /* "pyreadstat/_readstat_writer.pyx":305 * equal = True * # let's deal first with object type, Enum could also be anything * if col_type == nw.Object or col_type==nw.Enum: # <<<<<<<<<<<<<< * curtype = type(curseries[0]) * equal = check_series_all_same_types(curseries, curtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L19_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Enum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Enum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L19_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":302 + /* "pyreadstat/_readstat_writer.pyx":306 * # let's deal first with object type, Enum could also be anything * if col_type == nw.Object or col_type==nw.Enum: * curtype = type(curseries[0]) # <<<<<<<<<<<<<< * equal = check_series_all_same_types(curseries, curtype) * # if all elements are equal, they could be a few we expect to be an object class */ - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_curseries, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_curseries, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_13))); __Pyx_DECREF_SET(__pyx_v_curtype, ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_t_13)))); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":303 + /* "pyreadstat/_readstat_writer.pyx":307 * if col_type == nw.Object or col_type==nw.Enum: * curtype = type(curseries[0]) * equal = check_series_all_same_types(curseries, curtype) # <<<<<<<<<<<<<< * # if all elements are equal, they could be a few we expect to be an object class * # or it could be that they are some other common types (numeric) after removing the missing_user_values */ - __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(__pyx_v_curseries, ((PyObject *)__pyx_v_curtype)); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(__pyx_v_curseries, ((PyObject *)__pyx_v_curtype)); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_v_equal = __pyx_t_15; - /* "pyreadstat/_readstat_writer.pyx":309 + /* "pyreadstat/_readstat_writer.pyx":313 * # if not all the elements of the series are from the same type, then we deal with it at the end * # as other types we don't know what to do with * if equal: # <<<<<<<<<<<<<< @@ -6748,53 +6820,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (__pyx_v_equal != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":311 + /* "pyreadstat/_readstat_writer.pyx":315 * if equal: * # types expected to be object * if curtype == datetime.date: # <<<<<<<<<<<<<< * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":312 + /* "pyreadstat/_readstat_writer.pyx":316 * # types expected to be object * if curtype == datetime.date: * result.append((PYWRITER_DATE, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif curtype == datetime.datetime: */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 316, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 316, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 316, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 316, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":313 + /* "pyreadstat/_readstat_writer.pyx":317 * if curtype == datetime.date: * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -6803,7 +6875,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":311 + /* "pyreadstat/_readstat_writer.pyx":315 * if equal: * # types expected to be object * if curtype == datetime.date: # <<<<<<<<<<<<<< @@ -6812,53 +6884,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":314 + /* "pyreadstat/_readstat_writer.pyx":318 * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue * elif curtype == datetime.datetime: # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":315 + /* "pyreadstat/_readstat_writer.pyx":319 * continue * elif curtype == datetime.datetime: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif curtype == datetime.time: */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":316 + /* "pyreadstat/_readstat_writer.pyx":320 * elif curtype == datetime.datetime: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -6867,7 +6939,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":314 + /* "pyreadstat/_readstat_writer.pyx":318 * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue * elif curtype == datetime.datetime: # <<<<<<<<<<<<<< @@ -6876,53 +6948,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":317 + /* "pyreadstat/_readstat_writer.pyx":321 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif curtype == datetime.time: # <<<<<<<<<<<<<< * result.append((PYWRITER_TIME, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":318 + /* "pyreadstat/_readstat_writer.pyx":322 * continue * elif curtype == datetime.time: * result.append((PYWRITER_TIME, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 322, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 322, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 322, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 322, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":319 + /* "pyreadstat/_readstat_writer.pyx":323 * elif curtype == datetime.time: * result.append((PYWRITER_TIME, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -6931,7 +7003,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":317 + /* "pyreadstat/_readstat_writer.pyx":321 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif curtype == datetime.time: # <<<<<<<<<<<<<< @@ -6940,7 +7012,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":309 + /* "pyreadstat/_readstat_writer.pyx":313 * # if not all the elements of the series are from the same type, then we deal with it at the end * # as other types we don't know what to do with * if equal: # <<<<<<<<<<<<<< @@ -6949,7 +7021,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":301 + /* "pyreadstat/_readstat_writer.pyx":305 * equal = True * # let's deal first with object type, Enum could also be anything * if col_type == nw.Object or col_type==nw.Enum: # <<<<<<<<<<<<<< @@ -6958,7 +7030,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":322 + /* "pyreadstat/_readstat_writer.pyx":326 * * # numeric types: they could contain missing_user_values * if equal and (col_type in float_types or curtype == float): # <<<<<<<<<<<<<< @@ -6973,50 +7045,50 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_float_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 322, __pyx_L1_error) + __PYX_ERR(0, 326, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_float_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_float_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L24_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L24_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":323 + /* "pyreadstat/_readstat_writer.pyx":327 * # numeric types: they could contain missing_user_values * if equal and (col_type in float_types or curtype == float): * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif equal and (col_type in int_types or curtype == int): */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 327, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 327, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 327, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 327, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":324 + /* "pyreadstat/_readstat_writer.pyx":328 * if equal and (col_type in float_types or curtype == float): * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7025,7 +7097,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":322 + /* "pyreadstat/_readstat_writer.pyx":326 * * # numeric types: they could contain missing_user_values * if equal and (col_type in float_types or curtype == float): # <<<<<<<<<<<<<< @@ -7034,7 +7106,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":325 + /* "pyreadstat/_readstat_writer.pyx":329 * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) * continue * elif equal and (col_type in int_types or curtype == int): # <<<<<<<<<<<<<< @@ -7049,50 +7121,50 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_int_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 325, __pyx_L1_error) + __PYX_ERR(0, 329, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L27_bool_binop_done; } - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 325, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L27_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":326 + /* "pyreadstat/_readstat_writer.pyx":330 * continue * elif equal and (col_type in int_types or curtype == int): * result.append((PYWRITER_INTEGER, 0,has_missing, None)) # <<<<<<<<<<<<<< * continue * elif equal and (col_type == nw.Boolean or curtype == bool): */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 330, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 330, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 330, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 330, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":327 + /* "pyreadstat/_readstat_writer.pyx":331 * elif equal and (col_type in int_types or curtype == int): * result.append((PYWRITER_INTEGER, 0,has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7101,7 +7173,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":325 + /* "pyreadstat/_readstat_writer.pyx":329 * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) * continue * elif equal and (col_type in int_types or curtype == int): # <<<<<<<<<<<<<< @@ -7110,7 +7182,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":328 + /* "pyreadstat/_readstat_writer.pyx":332 * result.append((PYWRITER_INTEGER, 0,has_missing, None)) * continue * elif equal and (col_type == nw.Boolean or curtype == bool): # <<<<<<<<<<<<<< @@ -7123,56 +7195,56 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = __pyx_t_10; goto __pyx_L30_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Boolean); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Boolean); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L30_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyBool_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyBool_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L30_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":329 + /* "pyreadstat/_readstat_writer.pyx":333 * continue * elif equal and (col_type == nw.Boolean or curtype == bool): * result.append((PYWRITER_LOGICAL, 0,has_missing, None)) # <<<<<<<<<<<<<< * continue * # these types here should not contain missing_user_values, */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 333, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 333, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 333, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 333, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":330 + /* "pyreadstat/_readstat_writer.pyx":334 * elif equal and (col_type == nw.Boolean or curtype == bool): * result.append((PYWRITER_LOGICAL, 0,has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7181,7 +7253,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":328 + /* "pyreadstat/_readstat_writer.pyx":332 * result.append((PYWRITER_INTEGER, 0,has_missing, None)) * continue * elif equal and (col_type == nw.Boolean or curtype == bool): # <<<<<<<<<<<<<< @@ -7190,35 +7262,35 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":333 + /* "pyreadstat/_readstat_writer.pyx":337 * # these types here should not contain missing_user_values, * # for string we still check, as later we will raise an error * elif col_type == nw.String or curtype == str: # <<<<<<<<<<<<<< * isobject = 0 * if not equal: */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_String); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_String); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L33_bool_binop_done; } - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L33_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":334 + /* "pyreadstat/_readstat_writer.pyx":338 * # for string we still check, as later we will raise an error * elif col_type == nw.String or curtype == str: * isobject = 0 # <<<<<<<<<<<<<< @@ -7227,7 +7299,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_isobject = 0; - /* "pyreadstat/_readstat_writer.pyx":335 + /* "pyreadstat/_readstat_writer.pyx":339 * elif col_type == nw.String or curtype == str: * isobject = 0 * if not equal: # <<<<<<<<<<<<<< @@ -7237,7 +7309,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (!(__pyx_v_equal != 0)); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":336 + /* "pyreadstat/_readstat_writer.pyx":340 * isobject = 0 * if not equal: * isobject = 1 # <<<<<<<<<<<<<< @@ -7246,7 +7318,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_isobject = 1; - /* "pyreadstat/_readstat_writer.pyx":335 + /* "pyreadstat/_readstat_writer.pyx":339 * elif col_type == nw.String or curtype == str: * isobject = 0 * if not equal: # <<<<<<<<<<<<<< @@ -7255,7 +7327,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":337 + /* "pyreadstat/_readstat_writer.pyx":341 * if not equal: * isobject = 1 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) # <<<<<<<<<<<<<< @@ -7264,16 +7336,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 337, __pyx_L1_error) + __PYX_ERR(0, 341, __pyx_L1_error) } - __pyx_t_13 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (!(likely(PyDict_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_13))) __PYX_ERR(0, 337, __pyx_L1_error) - __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_13), __pyx_v_isobject); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_13))) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_13), __pyx_v_isobject); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_max_length = __pyx_t_15; - /* "pyreadstat/_readstat_writer.pyx":338 + /* "pyreadstat/_readstat_writer.pyx":342 * isobject = 1 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7291,37 +7363,37 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_L37_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":339 + /* "pyreadstat/_readstat_writer.pyx":343 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) * if dta_str_max_len and max_length >= dta_str_max_len: * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":340 + /* "pyreadstat/_readstat_writer.pyx":344 * if dta_str_max_len and max_length >= dta_str_max_len: * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7330,7 +7402,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":338 + /* "pyreadstat/_readstat_writer.pyx":342 * isobject = 1 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7339,7 +7411,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":342 + /* "pyreadstat/_readstat_writer.pyx":346 * continue * else: * if isobject: # <<<<<<<<<<<<<< @@ -7350,37 +7422,37 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (__pyx_v_isobject != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":343 + /* "pyreadstat/_readstat_writer.pyx":347 * else: * if isobject: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) # <<<<<<<<<<<<<< * else: * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":342 + /* "pyreadstat/_readstat_writer.pyx":346 * continue * else: * if isobject: # <<<<<<<<<<<<<< @@ -7390,7 +7462,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L39; } - /* "pyreadstat/_readstat_writer.pyx":345 + /* "pyreadstat/_readstat_writer.pyx":349 * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) * else: * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) # <<<<<<<<<<<<<< @@ -7398,32 +7470,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ * elif col_type == nw.Datetime: */ /*else*/ { - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L39:; - /* "pyreadstat/_readstat_writer.pyx":346 + /* "pyreadstat/_readstat_writer.pyx":350 * else: * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7433,7 +7505,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L4_continue; } - /* "pyreadstat/_readstat_writer.pyx":333 + /* "pyreadstat/_readstat_writer.pyx":337 * # these types here should not contain missing_user_values, * # for string we still check, as later we will raise an error * elif col_type == nw.String or curtype == str: # <<<<<<<<<<<<<< @@ -7442,66 +7514,66 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":347 + /* "pyreadstat/_readstat_writer.pyx":351 * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) * continue * elif col_type == nw.Datetime: # <<<<<<<<<<<<<< * if col_type.time_unit == 'us': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":348 + /* "pyreadstat/_readstat_writer.pyx":352 * continue * elif col_type == nw.Datetime: * if col_type.time_unit == 'us': # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":349 + /* "pyreadstat/_readstat_writer.pyx":353 * elif col_type == nw.Datetime: * if col_type.time_unit == 'us': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) # <<<<<<<<<<<<<< * continue * elif col_type.time_unit == 'ns': */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 353, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 353, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 353, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_us); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_us); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_us) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_us) != (0)) __PYX_ERR(0, 353, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":350 + /* "pyreadstat/_readstat_writer.pyx":354 * if col_type.time_unit == 'us': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue # <<<<<<<<<<<<<< @@ -7510,7 +7582,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":348 + /* "pyreadstat/_readstat_writer.pyx":352 * continue * elif col_type == nw.Datetime: * if col_type.time_unit == 'us': # <<<<<<<<<<<<<< @@ -7519,48 +7591,48 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":351 + /* "pyreadstat/_readstat_writer.pyx":355 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue * elif col_type.time_unit == 'ns': # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":352 + /* "pyreadstat/_readstat_writer.pyx":356 * continue * elif col_type.time_unit == 'ns': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) # <<<<<<<<<<<<<< * continue * elif col_type.time_unit == 'ms': */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 356, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 356, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 356, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ns); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ns); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_n_u_ns) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_n_u_ns) != (0)) __PYX_ERR(0, 356, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":353 + /* "pyreadstat/_readstat_writer.pyx":357 * elif col_type.time_unit == 'ns': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue # <<<<<<<<<<<<<< @@ -7569,7 +7641,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":351 + /* "pyreadstat/_readstat_writer.pyx":355 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue * elif col_type.time_unit == 'ns': # <<<<<<<<<<<<<< @@ -7578,48 +7650,48 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":354 + /* "pyreadstat/_readstat_writer.pyx":358 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue * elif col_type.time_unit == 'ms': # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ms')) * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":355 + /* "pyreadstat/_readstat_writer.pyx":359 * continue * elif col_type.time_unit == 'ms': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ms')) # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 359, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 359, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 359, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ms); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ms); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_ms) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_ms) != (0)) __PYX_ERR(0, 359, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":356 + /* "pyreadstat/_readstat_writer.pyx":360 * elif col_type.time_unit == 'ms': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ms')) * continue # <<<<<<<<<<<<<< @@ -7628,7 +7700,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":354 + /* "pyreadstat/_readstat_writer.pyx":358 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue * elif col_type.time_unit == 'ms': # <<<<<<<<<<<<<< @@ -7637,7 +7709,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":358 + /* "pyreadstat/_readstat_writer.pyx":362 * continue * else: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) # <<<<<<<<<<<<<< @@ -7645,28 +7717,28 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ * elif col_type == nw.Date: */ /*else*/ { - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 362, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 362, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 362, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 362, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":359 + /* "pyreadstat/_readstat_writer.pyx":363 * else: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7676,7 +7748,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L4_continue; } - /* "pyreadstat/_readstat_writer.pyx":347 + /* "pyreadstat/_readstat_writer.pyx":351 * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) * continue * elif col_type == nw.Datetime: # <<<<<<<<<<<<<< @@ -7685,53 +7757,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":360 + /* "pyreadstat/_readstat_writer.pyx":364 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif col_type == nw.Date: # <<<<<<<<<<<<<< * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":361 + /* "pyreadstat/_readstat_writer.pyx":365 * continue * elif col_type == nw.Date: * result.append((PYWRITER_DATE64, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif col_type == nw.Time: */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 365, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 365, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 365, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, Py_None) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, Py_None) != (0)) __PYX_ERR(0, 365, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":362 + /* "pyreadstat/_readstat_writer.pyx":366 * elif col_type == nw.Date: * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7740,7 +7812,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":360 + /* "pyreadstat/_readstat_writer.pyx":364 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif col_type == nw.Date: # <<<<<<<<<<<<<< @@ -7749,53 +7821,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":363 + /* "pyreadstat/_readstat_writer.pyx":367 * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue * elif col_type == nw.Time: # <<<<<<<<<<<<<< * result.append((PYWRITER_TIME64, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":364 + /* "pyreadstat/_readstat_writer.pyx":368 * continue * elif col_type == nw.Time: * result.append((PYWRITER_TIME64, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 368, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 368, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 368, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 368, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":365 + /* "pyreadstat/_readstat_writer.pyx":369 * elif col_type == nw.Time: * result.append((PYWRITER_TIME64, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7804,7 +7876,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":363 + /* "pyreadstat/_readstat_writer.pyx":367 * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue * elif col_type == nw.Time: # <<<<<<<<<<<<<< @@ -7813,7 +7885,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":368 + /* "pyreadstat/_readstat_writer.pyx":372 * * # if the object was not captured by any of the previous cases, we transform it to string * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) # <<<<<<<<<<<<<< @@ -7822,16 +7894,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 368, __pyx_L1_error) + __PYX_ERR(0, 372, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 368, __pyx_L1_error) - __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_1), 1); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_1), 1); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_max_length = __pyx_t_15; - /* "pyreadstat/_readstat_writer.pyx":369 + /* "pyreadstat/_readstat_writer.pyx":373 * # if the object was not captured by any of the previous cases, we transform it to string * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7849,37 +7921,37 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_L42_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":370 + /* "pyreadstat/_readstat_writer.pyx":374 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) * if dta_str_max_len and max_length >= dta_str_max_len: * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) # <<<<<<<<<<<<<< * else: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":369 + /* "pyreadstat/_readstat_writer.pyx":373 * # if the object was not captured by any of the previous cases, we transform it to string * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7889,7 +7961,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L41; } - /* "pyreadstat/_readstat_writer.pyx":372 + /* "pyreadstat/_readstat_writer.pyx":376 * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) * else: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) # <<<<<<<<<<<<<< @@ -7897,32 +7969,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ * */ /*else*/ { - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 376, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 376, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 376, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 376, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L41:; - /* "pyreadstat/_readstat_writer.pyx":373 + /* "pyreadstat/_readstat_writer.pyx":377 * else: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7931,7 +8003,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":267 + /* "pyreadstat/_readstat_writer.pyx":271 * variable_value_labels = dict() * * for curseries in df.iter_columns(): # <<<<<<<<<<<<<< @@ -7942,7 +8014,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":375 + /* "pyreadstat/_readstat_writer.pyx":379 * continue * * return result # <<<<<<<<<<<<<< @@ -7954,7 +8026,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":250 + /* "pyreadstat/_readstat_writer.pyx":254 * return 1 * * cdef list get_narwhals_column_types(object df, dict missing_user_values, dict variable_value_labels, int dta_str_max_len): # <<<<<<<<<<<<<< @@ -7985,7 +8057,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":377 +/* "pyreadstat/_readstat_writer.pyx":381 * return result * * cdef readstat_label_set_t *set_value_label(readstat_writer_t *writer, dict value_labels, str labelset_name, # <<<<<<<<<<<<<< @@ -8029,7 +8101,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_value_label", 0); - /* "pyreadstat/_readstat_writer.pyx":388 + /* "pyreadstat/_readstat_writer.pyx":392 * cdef double double_val * * curtype = narwhals_to_readstat_types[curpytype] # <<<<<<<<<<<<<< @@ -8038,18 +8110,18 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 388, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curpytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curpytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_3 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_curtype = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":389 + /* "pyreadstat/_readstat_writer.pyx":393 * * curtype = narwhals_to_readstat_types[curpytype] * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) # <<<<<<<<<<<<<< @@ -8058,15 +8130,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_labelset_name == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 389, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) } - __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_labelset_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_labelset_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_v_label_set = readstat_add_label_set(__pyx_v_writer, __pyx_v_curtype, __pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":391 + /* "pyreadstat/_readstat_writer.pyx":395 * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) * * for value, label in value_labels.items(): # <<<<<<<<<<<<<< @@ -8075,18 +8147,18 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -8095,7 +8167,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 395, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8105,7 +8177,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 395, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8116,13 +8188,13 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 395, __pyx_L1_error) PyErr_Clear(); } break; @@ -8135,7 +8207,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8145,22 +8217,22 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -8168,7 +8240,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 391, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; @@ -8176,7 +8248,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); @@ -8184,28 +8256,28 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":393 + /* "pyreadstat/_readstat_writer.pyx":397 * for value, label in value_labels.items(): * * if type(label) != str: # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_label)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_label)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":394 + /* "pyreadstat/_readstat_writer.pyx":398 * * if type(label) != str: * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_La; __pyx_t_12[1] = __pyx_t_2; @@ -8213,14 +8285,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_8; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_string; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 15, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":395 + /* "pyreadstat/_readstat_writer.pyx":399 * if type(label) != str: * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8228,7 +8300,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * if user_missing_tags and value in user_missing_tags: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8247,14 +8319,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 395, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":393 + /* "pyreadstat/_readstat_writer.pyx":397 * for value, label in value_labels.items(): * * if type(label) != str: # <<<<<<<<<<<<<< @@ -8263,7 +8335,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":397 + /* "pyreadstat/_readstat_writer.pyx":401 * raise PyreadstatError(msg) * * if user_missing_tags and value in user_missing_tags: # <<<<<<<<<<<<<< @@ -8274,7 +8346,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l else { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_user_missing_tags); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 397, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_t_14 = (__pyx_temp != 0); } @@ -8283,12 +8355,12 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_11 = __pyx_t_14; goto __pyx_L9_bool_binop_done; } - __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_user_missing_tags, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_user_missing_tags, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L9_bool_binop_done:; if (__pyx_t_11) { - /* "pyreadstat/_readstat_writer.pyx":398 + /* "pyreadstat/_readstat_writer.pyx":402 * * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8300,19 +8372,19 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF: - /* "pyreadstat/_readstat_writer.pyx":399 + /* "pyreadstat/_readstat_writer.pyx":403 * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * msg = "missing_user_values not allowed for character variable %s" % variable_name # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_not_allowed, __pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_not_allowed, __pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_msg = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":400 + /* "pyreadstat/_readstat_writer.pyx":404 * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * msg = "missing_user_values not allowed for character variable %s" % variable_name * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8320,7 +8392,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8339,14 +8411,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 400, __pyx_L1_error) + __PYX_ERR(0, 404, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":398 + /* "pyreadstat/_readstat_writer.pyx":402 * * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8357,14 +8429,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l default: break; } - /* "pyreadstat/_readstat_writer.pyx":402 + /* "pyreadstat/_readstat_writer.pyx":406 * raise PyreadstatError(msg) * * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_15 = __Pyx_PyObject_Ord(__pyx_v_value); if (unlikely(__pyx_t_15 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Ord(__pyx_v_value); if (unlikely(__pyx_t_15 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 406, __pyx_L1_error) __pyx_t_8 = __pyx_v_label; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0; @@ -8372,14 +8444,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L1_error) readstat_label_tagged_value(__pyx_v_label_set, __pyx_t_15, __pyx_t_16); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":403 + /* "pyreadstat/_readstat_writer.pyx":407 * * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) * continue # <<<<<<<<<<<<<< @@ -8388,7 +8460,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ goto __pyx_L3_continue; - /* "pyreadstat/_readstat_writer.pyx":397 + /* "pyreadstat/_readstat_writer.pyx":401 * raise PyreadstatError(msg) * * if user_missing_tags and value in user_missing_tags: # <<<<<<<<<<<<<< @@ -8397,7 +8469,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":406 + /* "pyreadstat/_readstat_writer.pyx":410 * * * if curpytype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -8407,38 +8479,38 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l switch (__pyx_v_curpytype) { case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE: - /* "pyreadstat/_readstat_writer.pyx":407 + /* "pyreadstat/_readstat_writer.pyx":411 * * if curpytype == PYWRITER_DOUBLE: * if type(value) != float and type(value) != int: # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyFloat_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyFloat_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L12_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = __pyx_t_14; __pyx_L12_bool_binop_done:; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":408 + /* "pyreadstat/_readstat_writer.pyx":412 * if curpytype == PYWRITER_DOUBLE: * if type(value) != float and type(value) != int: * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_double_value(label_set, value, label.encode("utf-8")) */ - __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_7; @@ -8446,14 +8518,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_8; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_numeric; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 16, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":409 + /* "pyreadstat/_readstat_writer.pyx":413 * if type(value) != float and type(value) != int: * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8461,7 +8533,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8480,14 +8552,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 413, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":407 + /* "pyreadstat/_readstat_writer.pyx":411 * * if curpytype == PYWRITER_DOUBLE: * if type(value) != float and type(value) != int: # <<<<<<<<<<<<<< @@ -8496,14 +8568,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":410 + /* "pyreadstat/_readstat_writer.pyx":414 * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_double_value(label_set, value, label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_INTEGER: */ - __pyx_t_17 = __Pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 414, __pyx_L1_error) __pyx_t_7 = __pyx_v_label; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; @@ -8511,14 +8583,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 414, __pyx_L1_error) readstat_label_double_value(__pyx_v_label_set, __pyx_t_17, __pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":406 + /* "pyreadstat/_readstat_writer.pyx":410 * * * if curpytype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -8528,28 +8600,28 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER: - /* "pyreadstat/_readstat_writer.pyx":413 + /* "pyreadstat/_readstat_writer.pyx":417 * * elif curpytype == PYWRITER_INTEGER: * if type(value) != int: # <<<<<<<<<<<<<< * #if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":415 + /* "pyreadstat/_readstat_writer.pyx":419 * if type(value) != int: * #if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, value, label.encode("utf-8")) */ - __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_2; @@ -8557,14 +8629,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_7; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_int; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 12, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 415, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":416 + /* "pyreadstat/_readstat_writer.pyx":420 * #if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8572,7 +8644,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8591,14 +8663,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 416, __pyx_L1_error) + __PYX_ERR(0, 420, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":413 + /* "pyreadstat/_readstat_writer.pyx":417 * * elif curpytype == PYWRITER_INTEGER: * if type(value) != int: # <<<<<<<<<<<<<< @@ -8607,14 +8679,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":417 + /* "pyreadstat/_readstat_writer.pyx":421 * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, value, label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_LOGICAL: */ - __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_t_2 = __pyx_v_label; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; @@ -8622,14 +8694,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 417, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) readstat_label_int32_value(__pyx_v_label_set, __pyx_t_19, __pyx_t_20); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":412 + /* "pyreadstat/_readstat_writer.pyx":416 * readstat_label_double_value(label_set, value, label.encode("utf-8")) * * elif curpytype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< @@ -8639,42 +8711,42 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL: - /* "pyreadstat/_readstat_writer.pyx":420 + /* "pyreadstat/_readstat_writer.pyx":424 * * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_8 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyBool_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyBool_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L16_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L16_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 424, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L16_bool_binop_done:; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":421 + /* "pyreadstat/_readstat_writer.pyx":425 * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) */ - __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_8; @@ -8682,14 +8754,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_2; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_boolean_or_be_1_or_0; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 29, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":422 + /* "pyreadstat/_readstat_writer.pyx":426 * if type(value) != bool and (value != 0 and value != 1): * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8697,7 +8769,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8716,14 +8788,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 422, __pyx_L1_error) + __PYX_ERR(0, 426, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":420 + /* "pyreadstat/_readstat_writer.pyx":424 * * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): # <<<<<<<<<<<<<< @@ -8732,16 +8804,16 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":423 + /* "pyreadstat/_readstat_writer.pyx":427 * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: */ - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __pyx_v_label; __Pyx_INCREF(__pyx_t_8); @@ -8750,14 +8822,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) readstat_label_int32_value(__pyx_v_label_set, __pyx_t_19, __pyx_t_20); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":419 + /* "pyreadstat/_readstat_writer.pyx":423 * readstat_label_int32_value(label_set, value, label.encode("utf-8")) * * elif curpytype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< @@ -8767,7 +8839,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER: - /* "pyreadstat/_readstat_writer.pyx":425 + /* "pyreadstat/_readstat_writer.pyx":429 * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8777,19 +8849,19 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF: - /* "pyreadstat/_readstat_writer.pyx":426 + /* "pyreadstat/_readstat_writer.pyx":430 * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * value = str(value) # <<<<<<<<<<<<<< * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * */ - __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":427 + /* "pyreadstat/_readstat_writer.pyx":431 * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * value = str(value) * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) # <<<<<<<<<<<<<< @@ -8803,10 +8875,10 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) __pyx_t_2 = __pyx_v_label; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; @@ -8814,15 +8886,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) readstat_label_string_value(__pyx_v_label_set, __pyx_t_21, __pyx_t_22); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":425 + /* "pyreadstat/_readstat_writer.pyx":429 * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8832,7 +8904,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: - /* "pyreadstat/_readstat_writer.pyx":429 + /* "pyreadstat/_readstat_writer.pyx":433 * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): # <<<<<<<<<<<<<< @@ -8845,7 +8917,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64: - /* "pyreadstat/_readstat_writer.pyx":430 + /* "pyreadstat/_readstat_writer.pyx":434 * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): * if type(value) not in nat_types: # <<<<<<<<<<<<<< @@ -8854,21 +8926,21 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_nat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 430, __pyx_L1_error) + __PYX_ERR(0, 434, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_nat_types, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_nat_types, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 434, __pyx_L1_error) if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":431 + /* "pyreadstat/_readstat_writer.pyx":435 * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): * if type(value) not in nat_types: * msg = "variable_value_labels: type of Value %s in variable %s must match the type of the column in dataframe and be of type date, datetime or time" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * double_val = convert_datetimelike_to_number(file_format, curpytype, value) */ - __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_8; @@ -8876,14 +8948,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_7; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_match_the_type_of_the_colu; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 85, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":432 + /* "pyreadstat/_readstat_writer.pyx":436 * if type(value) not in nat_types: * msg = "variable_value_labels: type of Value %s in variable %s must match the type of the column in dataframe and be of type date, datetime or time" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8891,7 +8963,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8910,14 +8982,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 432, __pyx_L1_error) + __PYX_ERR(0, 436, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":430 + /* "pyreadstat/_readstat_writer.pyx":434 * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): * if type(value) not in nat_types: # <<<<<<<<<<<<<< @@ -8926,17 +8998,17 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":433 + /* "pyreadstat/_readstat_writer.pyx":437 * msg = "variable_value_labels: type of Value %s in variable %s must match the type of the column in dataframe and be of type date, datetime or time" % (str(value), variable_name) * raise PyreadstatError(msg) * double_val = convert_datetimelike_to_number(file_format, curpytype, value) # <<<<<<<<<<<<<< * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) * */ - __pyx_t_17 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curpytype, __pyx_v_value); if (unlikely(__pyx_t_17 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_17 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curpytype, __pyx_v_value); if (unlikely(__pyx_t_17 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error) __pyx_v_double_val = __pyx_t_17; - /* "pyreadstat/_readstat_writer.pyx":434 + /* "pyreadstat/_readstat_writer.pyx":438 * raise PyreadstatError(msg) * double_val = convert_datetimelike_to_number(file_format, curpytype, value) * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) # <<<<<<<<<<<<<< @@ -8950,14 +9022,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) readstat_label_double_value(__pyx_v_label_set, __pyx_v_double_val, __pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":429 + /* "pyreadstat/_readstat_writer.pyx":433 * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): # <<<<<<<<<<<<<< @@ -8968,7 +9040,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l default: break; } - /* "pyreadstat/_readstat_writer.pyx":391 + /* "pyreadstat/_readstat_writer.pyx":395 * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) * * for value, label in value_labels.items(): # <<<<<<<<<<<<<< @@ -8979,7 +9051,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":436 + /* "pyreadstat/_readstat_writer.pyx":440 * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) * * return label_set # <<<<<<<<<<<<<< @@ -8989,7 +9061,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_r = __pyx_v_label_set; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":377 + /* "pyreadstat/_readstat_writer.pyx":381 * return result * * cdef readstat_label_set_t *set_value_label(readstat_writer_t *writer, dict value_labels, str labelset_name, # <<<<<<<<<<<<<< @@ -9014,7 +9086,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":438 +/* "pyreadstat/_readstat_writer.pyx":442 * return label_set * * cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable, pywriter_variable_type vartype, str variablename) except *: # <<<<<<<<<<<<<< @@ -9049,7 +9121,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_missing_ranges", 0); - /* "pyreadstat/_readstat_writer.pyx":444 + /* "pyreadstat/_readstat_writer.pyx":448 * """ * * cdef int range_values = 0 # <<<<<<<<<<<<<< @@ -9058,7 +9130,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_range_values = 0; - /* "pyreadstat/_readstat_writer.pyx":445 + /* "pyreadstat/_readstat_writer.pyx":449 * * cdef int range_values = 0 * cdef int discrete_values = 0 # <<<<<<<<<<<<<< @@ -9067,7 +9139,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = 0; - /* "pyreadstat/_readstat_writer.pyx":446 + /* "pyreadstat/_readstat_writer.pyx":450 * cdef int range_values = 0 * cdef int discrete_values = 0 * cdef int discrete_strings = 0 # <<<<<<<<<<<<<< @@ -9076,7 +9148,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = 0; - /* "pyreadstat/_readstat_writer.pyx":448 + /* "pyreadstat/_readstat_writer.pyx":452 * cdef int discrete_strings = 0 * * for cur_range in cur_ranges: # <<<<<<<<<<<<<< @@ -9085,7 +9157,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ if (unlikely(__pyx_v_cur_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 448, __pyx_L1_error) + __PYX_ERR(0, 452, __pyx_L1_error) } __pyx_t_1 = __pyx_v_cur_ranges; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -9093,18 +9165,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 448, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 452, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_cur_range, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":449 + /* "pyreadstat/_readstat_writer.pyx":453 * * for cur_range in cur_ranges: * if isinstance(cur_range, dict): # <<<<<<<<<<<<<< @@ -9114,7 +9186,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = PyDict_Check(__pyx_v_cur_range); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":450 + /* "pyreadstat/_readstat_writer.pyx":454 * for cur_range in cur_ranges: * if isinstance(cur_range, dict): * hi = cur_range.get("hi") # <<<<<<<<<<<<<< @@ -9128,13 +9200,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hi}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_hi, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":451 + /* "pyreadstat/_readstat_writer.pyx":455 * if isinstance(cur_range, dict): * hi = cur_range.get("hi") * lo = cur_range.get("lo") # <<<<<<<<<<<<<< @@ -9148,13 +9220,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_lo}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_lo, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":452 + /* "pyreadstat/_readstat_writer.pyx":456 * hi = cur_range.get("hi") * lo = cur_range.get("lo") * if hi is None or lo is None: # <<<<<<<<<<<<<< @@ -9172,7 +9244,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":453 + /* "pyreadstat/_readstat_writer.pyx":457 * lo = cur_range.get("lo") * if hi is None or lo is None: * msg = "dictionaries in missing_ranges must have the keys hi and lo" # <<<<<<<<<<<<<< @@ -9182,7 +9254,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dictionaries_in_missing_ranges_m); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_dictionaries_in_missing_ranges_m; - /* "pyreadstat/_readstat_writer.pyx":454 + /* "pyreadstat/_readstat_writer.pyx":458 * if hi is None or lo is None: * msg = "dictionaries in missing_ranges must have the keys hi and lo" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9190,7 +9262,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if vartype not in pywriter_numeric_types: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9209,14 +9281,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 454, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":452 + /* "pyreadstat/_readstat_writer.pyx":456 * hi = cur_range.get("hi") * lo = cur_range.get("lo") * if hi is None or lo is None: # <<<<<<<<<<<<<< @@ -9225,7 +9297,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":455 + /* "pyreadstat/_readstat_writer.pyx":459 * msg = "dictionaries in missing_ranges must have the keys hi and lo" * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): # <<<<<<<<<<<<<< @@ -9234,16 +9306,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_hi))); __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_hi)); - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L12_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L12_bool_binop_done:; @@ -9256,16 +9328,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lo))); __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_lo)); - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_7) { } else { __pyx_t_9 = __pyx_t_7; goto __pyx_L14_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = __pyx_t_7; __pyx_L14_bool_binop_done:; @@ -9275,36 +9347,36 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L10_bool_binop_done:; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":456 + /* "pyreadstat/_readstat_writer.pyx":460 * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) */ - __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 456, __pyx_L1_error) + __PYX_ERR(0, 460, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":457 + /* "pyreadstat/_readstat_writer.pyx":461 * if type(hi) in (int, float) and type(lo) in (int, float): * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * if hi == lo: */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":458 + /* "pyreadstat/_readstat_writer.pyx":462 * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9312,7 +9384,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9331,14 +9403,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 458, __pyx_L1_error) + __PYX_ERR(0, 462, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":456 + /* "pyreadstat/_readstat_writer.pyx":460 * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -9347,29 +9419,29 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":459 + /* "pyreadstat/_readstat_writer.pyx":463 * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) * discrete_values += 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":460 + /* "pyreadstat/_readstat_writer.pyx":464 * raise PyreadstatError(msg) * if hi == lo: * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) # <<<<<<<<<<<<<< * discrete_values += 1 * else: */ - __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __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, 464, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":461 + /* "pyreadstat/_readstat_writer.pyx":465 * if hi == lo: * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) * discrete_values += 1 # <<<<<<<<<<<<<< @@ -9378,7 +9450,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = (__pyx_v_discrete_values + 1); - /* "pyreadstat/_readstat_writer.pyx":459 + /* "pyreadstat/_readstat_writer.pyx":463 * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< @@ -9388,7 +9460,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L17; } - /* "pyreadstat/_readstat_writer.pyx":463 + /* "pyreadstat/_readstat_writer.pyx":467 * discrete_values += 1 * else: * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) # <<<<<<<<<<<<<< @@ -9396,11 +9468,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * elif type(hi) == str and type(lo) == str: */ /*else*/ { - __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_lo); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_range(__pyx_v_variable, __pyx_t_10, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_lo); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_range(__pyx_v_variable, __pyx_t_10, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":464 + /* "pyreadstat/_readstat_writer.pyx":468 * else: * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 # <<<<<<<<<<<<<< @@ -9411,7 +9483,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_L17:; - /* "pyreadstat/_readstat_writer.pyx":455 + /* "pyreadstat/_readstat_writer.pyx":459 * msg = "dictionaries in missing_ranges must have the keys hi and lo" * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): # <<<<<<<<<<<<<< @@ -9421,29 +9493,29 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":465 + /* "pyreadstat/_readstat_writer.pyx":469 * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 * elif type(hi) == str and type(lo) == str: # <<<<<<<<<<<<<< * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_hi)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_hi)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { } else { __pyx_t_4 = __pyx_t_7; goto __pyx_L18_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lo)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lo)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_7; __pyx_L18_bool_binop_done:; if (likely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":466 + /* "pyreadstat/_readstat_writer.pyx":470 * range_values += 1 * elif type(hi) == str and type(lo) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9462,19 +9534,19 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":467 + /* "pyreadstat/_readstat_writer.pyx":471 * elif type(hi) == str and type(lo) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * if hi == lo: */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":468 + /* "pyreadstat/_readstat_writer.pyx":472 * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9482,7 +9554,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if len(hi) > 8: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9501,14 +9573,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 468, __pyx_L1_error) + __PYX_ERR(0, 472, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":466 + /* "pyreadstat/_readstat_writer.pyx":470 * range_values += 1 * elif type(hi) == str and type(lo) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9517,30 +9589,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":469 + /* "pyreadstat/_readstat_writer.pyx":473 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":470 + /* "pyreadstat/_readstat_writer.pyx":474 * raise PyreadstatError(msg) * if hi == lo: * if len(hi) > 8: # <<<<<<<<<<<<<< * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) */ - __pyx_t_12 = PyObject_Length(__pyx_v_hi); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_hi); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 474, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 > 8); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":471 + /* "pyreadstat/_readstat_writer.pyx":475 * if hi == lo: * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" # <<<<<<<<<<<<<< @@ -9550,7 +9622,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len; - /* "pyreadstat/_readstat_writer.pyx":472 + /* "pyreadstat/_readstat_writer.pyx":476 * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9558,7 +9630,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * discrete_strings += 1 */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9577,14 +9649,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 472, __pyx_L1_error) + __PYX_ERR(0, 476, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":470 + /* "pyreadstat/_readstat_writer.pyx":474 * raise PyreadstatError(msg) * if hi == lo: * if len(hi) > 8: # <<<<<<<<<<<<<< @@ -9593,17 +9665,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":473 + /* "pyreadstat/_readstat_writer.pyx":477 * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, hi))#.encode("utf-8"))) # <<<<<<<<<<<<<< * discrete_strings += 1 * else: */ - __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_hi); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_hi); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":474 + /* "pyreadstat/_readstat_writer.pyx":478 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, hi))#.encode("utf-8"))) * discrete_strings += 1 # <<<<<<<<<<<<<< @@ -9612,7 +9684,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = (__pyx_v_discrete_strings + 1); - /* "pyreadstat/_readstat_writer.pyx":469 + /* "pyreadstat/_readstat_writer.pyx":473 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< @@ -9622,7 +9694,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L21; } - /* "pyreadstat/_readstat_writer.pyx":477 + /* "pyreadstat/_readstat_writer.pyx":481 * else: * #check_exit_status(readstat_variable_add_missing_string_range(variable, lo, hi)) * msg = "missing_ranges: hi and lo values must be both the same for string type" # <<<<<<<<<<<<<< @@ -9633,7 +9705,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values; - /* "pyreadstat/_readstat_writer.pyx":478 + /* "pyreadstat/_readstat_writer.pyx":482 * #check_exit_status(readstat_variable_add_missing_string_range(variable, lo, hi)) * msg = "missing_ranges: hi and lo values must be both the same for string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9641,7 +9713,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9660,16 +9732,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 478, __pyx_L1_error) + __PYX_ERR(0, 482, __pyx_L1_error) } __pyx_L21:; - /* "pyreadstat/_readstat_writer.pyx":465 + /* "pyreadstat/_readstat_writer.pyx":469 * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 * elif type(hi) == str and type(lo) == str: # <<<<<<<<<<<<<< @@ -9679,7 +9751,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":480 + /* "pyreadstat/_readstat_writer.pyx":484 * raise PyreadstatError(msg) * else: * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" # <<<<<<<<<<<<<< @@ -9690,7 +9762,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values_2); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values_2; - /* "pyreadstat/_readstat_writer.pyx":481 + /* "pyreadstat/_readstat_writer.pyx":485 * else: * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9698,7 +9770,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if type(cur_range) in (int, float): */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9717,16 +9789,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 481, __pyx_L1_error) + __PYX_ERR(0, 485, __pyx_L1_error) } __pyx_L9:; - /* "pyreadstat/_readstat_writer.pyx":449 + /* "pyreadstat/_readstat_writer.pyx":453 * * for cur_range in cur_ranges: * if isinstance(cur_range, dict): # <<<<<<<<<<<<<< @@ -9736,7 +9808,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L5; } - /* "pyreadstat/_readstat_writer.pyx":483 + /* "pyreadstat/_readstat_writer.pyx":487 * raise PyreadstatError(msg) * else: * if type(cur_range) in (int, float): # <<<<<<<<<<<<<< @@ -9746,16 +9818,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject /*else*/ { __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_cur_range))); __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_cur_range)); - __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_7) { } else { __pyx_t_4 = __pyx_t_7; goto __pyx_L24_bool_binop_done; } - __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_7; __pyx_L24_bool_binop_done:; @@ -9763,36 +9835,36 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = __pyx_t_4; if (__pyx_t_7) { - /* "pyreadstat/_readstat_writer.pyx":484 + /* "pyreadstat/_readstat_writer.pyx":488 * else: * if type(cur_range) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) */ - __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 484, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":485 + /* "pyreadstat/_readstat_writer.pyx":489 * if type(cur_range) in (int, float): * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":486 + /* "pyreadstat/_readstat_writer.pyx":490 * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9800,7 +9872,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * discrete_values += 1 */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9819,14 +9891,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 486, __pyx_L1_error) + __PYX_ERR(0, 490, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":484 + /* "pyreadstat/_readstat_writer.pyx":488 * else: * if type(cur_range) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -9835,17 +9907,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":487 + /* "pyreadstat/_readstat_writer.pyx":491 * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) # <<<<<<<<<<<<<< * discrete_values += 1 * elif type(cur_range) == str: */ - __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_cur_range); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_cur_range); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":488 + /* "pyreadstat/_readstat_writer.pyx":492 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 # <<<<<<<<<<<<<< @@ -9854,7 +9926,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = (__pyx_v_discrete_values + 1); - /* "pyreadstat/_readstat_writer.pyx":483 + /* "pyreadstat/_readstat_writer.pyx":487 * raise PyreadstatError(msg) * else: * if type(cur_range) in (int, float): # <<<<<<<<<<<<<< @@ -9864,19 +9936,19 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L23; } - /* "pyreadstat/_readstat_writer.pyx":489 + /* "pyreadstat/_readstat_writer.pyx":493 * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 * elif type(cur_range) == str: # <<<<<<<<<<<<<< * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cur_range)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cur_range)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":490 + /* "pyreadstat/_readstat_writer.pyx":494 * discrete_values += 1 * elif type(cur_range) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9902,19 +9974,19 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L28_bool_binop_done:; if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":491 + /* "pyreadstat/_readstat_writer.pyx":495 * elif type(cur_range) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * if len(cur_range) > 8: */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":492 + /* "pyreadstat/_readstat_writer.pyx":496 * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9922,7 +9994,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: string values length must not be larger than 8" */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9941,14 +10013,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 492, __pyx_L1_error) + __PYX_ERR(0, 496, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":490 + /* "pyreadstat/_readstat_writer.pyx":494 * discrete_values += 1 * elif type(cur_range) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9957,18 +10029,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":493 + /* "pyreadstat/_readstat_writer.pyx":497 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if len(cur_range) > 8: # <<<<<<<<<<<<<< * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) */ - __pyx_t_12 = PyObject_Length(__pyx_v_cur_range); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_cur_range); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 497, __pyx_L1_error) __pyx_t_7 = (__pyx_t_12 > 8); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":494 + /* "pyreadstat/_readstat_writer.pyx":498 * raise PyreadstatError(msg) * if len(cur_range) > 8: * msg = "missing_ranges: string values length must not be larger than 8" # <<<<<<<<<<<<<< @@ -9978,7 +10050,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len; - /* "pyreadstat/_readstat_writer.pyx":495 + /* "pyreadstat/_readstat_writer.pyx":499 * if len(cur_range) > 8: * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9986,7 +10058,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * discrete_strings += 1 */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10005,14 +10077,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 495, __pyx_L1_error) + __PYX_ERR(0, 499, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":493 + /* "pyreadstat/_readstat_writer.pyx":497 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if len(cur_range) > 8: # <<<<<<<<<<<<<< @@ -10021,17 +10093,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":496 + /* "pyreadstat/_readstat_writer.pyx":500 * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, cur_range))#.encode("utf-8"))) # <<<<<<<<<<<<<< * discrete_strings += 1 * else: */ - __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_cur_range); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_cur_range); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":497 + /* "pyreadstat/_readstat_writer.pyx":501 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, cur_range))#.encode("utf-8"))) * discrete_strings += 1 # <<<<<<<<<<<<<< @@ -10040,7 +10112,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = (__pyx_v_discrete_strings + 1); - /* "pyreadstat/_readstat_writer.pyx":489 + /* "pyreadstat/_readstat_writer.pyx":493 * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 * elif type(cur_range) == str: # <<<<<<<<<<<<<< @@ -10050,7 +10122,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L23; } - /* "pyreadstat/_readstat_writer.pyx":499 + /* "pyreadstat/_readstat_writer.pyx":503 * discrete_strings += 1 * else: * msg = "missing_ranges: values must be both either of numeric or string type" # <<<<<<<<<<<<<< @@ -10061,7 +10133,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_values_must_be_bo); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_values_must_be_bo; - /* "pyreadstat/_readstat_writer.pyx":500 + /* "pyreadstat/_readstat_writer.pyx":504 * else: * msg = "missing_ranges: values must be both either of numeric or string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10069,7 +10141,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if discrete_strings > 3: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10088,18 +10160,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 500, __pyx_L1_error) + __PYX_ERR(0, 504, __pyx_L1_error) } __pyx_L23:; } __pyx_L5:; - /* "pyreadstat/_readstat_writer.pyx":502 + /* "pyreadstat/_readstat_writer.pyx":506 * raise PyreadstatError(msg) * * if discrete_strings > 3: # <<<<<<<<<<<<<< @@ -10109,7 +10181,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_discrete_strings > 3); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":503 + /* "pyreadstat/_readstat_writer.pyx":507 * * if discrete_strings > 3: * msg = "missing_ranges: max 3 string values per variable allowed" # <<<<<<<<<<<<<< @@ -10119,7 +10191,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_string_valu); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_string_valu; - /* "pyreadstat/_readstat_writer.pyx":504 + /* "pyreadstat/_readstat_writer.pyx":508 * if discrete_strings > 3: * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10127,7 +10199,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if range_values > 1: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10146,14 +10218,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 504, __pyx_L1_error) + __PYX_ERR(0, 508, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":502 + /* "pyreadstat/_readstat_writer.pyx":506 * raise PyreadstatError(msg) * * if discrete_strings > 3: # <<<<<<<<<<<<<< @@ -10162,7 +10234,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":505 + /* "pyreadstat/_readstat_writer.pyx":509 * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) * if range_values: # <<<<<<<<<<<<<< @@ -10172,7 +10244,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_range_values != 0); if (__pyx_t_7) { - /* "pyreadstat/_readstat_writer.pyx":506 + /* "pyreadstat/_readstat_writer.pyx":510 * raise PyreadstatError(msg) * if range_values: * if range_values > 1: # <<<<<<<<<<<<<< @@ -10182,7 +10254,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_range_values > 1); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":507 + /* "pyreadstat/_readstat_writer.pyx":511 * if range_values: * if range_values > 1: * msg = "missing_ranges: max 1 range value per variable allowed" # <<<<<<<<<<<<<< @@ -10192,7 +10264,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_range_value); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_range_value; - /* "pyreadstat/_readstat_writer.pyx":508 + /* "pyreadstat/_readstat_writer.pyx":512 * if range_values > 1: * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10200,7 +10272,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10219,14 +10291,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 508, __pyx_L1_error) + __PYX_ERR(0, 512, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":506 + /* "pyreadstat/_readstat_writer.pyx":510 * raise PyreadstatError(msg) * if range_values: * if range_values > 1: # <<<<<<<<<<<<<< @@ -10235,7 +10307,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":509 + /* "pyreadstat/_readstat_writer.pyx":513 * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values > 1: # <<<<<<<<<<<<<< @@ -10245,7 +10317,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_discrete_values > 1); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":510 + /* "pyreadstat/_readstat_writer.pyx":514 * raise PyreadstatError(msg) * if discrete_values > 1: * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" # <<<<<<<<<<<<<< @@ -10255,7 +10327,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_discrete_nu); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_discrete_nu; - /* "pyreadstat/_readstat_writer.pyx":511 + /* "pyreadstat/_readstat_writer.pyx":515 * if discrete_values > 1: * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10263,7 +10335,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 511, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10282,14 +10354,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 511, __pyx_L1_error) + __PYX_ERR(0, 515, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":509 + /* "pyreadstat/_readstat_writer.pyx":513 * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values > 1: # <<<<<<<<<<<<<< @@ -10298,7 +10370,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":505 + /* "pyreadstat/_readstat_writer.pyx":509 * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) * if range_values: # <<<<<<<<<<<<<< @@ -10307,7 +10379,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":512 + /* "pyreadstat/_readstat_writer.pyx":516 * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values >3: # <<<<<<<<<<<<<< @@ -10317,7 +10389,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_discrete_values > 3); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":513 + /* "pyreadstat/_readstat_writer.pyx":517 * raise PyreadstatError(msg) * if discrete_values >3: * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" # <<<<<<<<<<<<<< @@ -10327,7 +10399,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_discrete_nu); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_discrete_nu; - /* "pyreadstat/_readstat_writer.pyx":514 + /* "pyreadstat/_readstat_writer.pyx":518 * if discrete_values >3: * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10335,7 +10407,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10354,14 +10426,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 514, __pyx_L1_error) + __PYX_ERR(0, 518, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":512 + /* "pyreadstat/_readstat_writer.pyx":516 * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values >3: # <<<<<<<<<<<<<< @@ -10370,7 +10442,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":448 + /* "pyreadstat/_readstat_writer.pyx":452 * cdef int discrete_strings = 0 * * for cur_range in cur_ranges: # <<<<<<<<<<<<<< @@ -10380,7 +10452,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":438 + /* "pyreadstat/_readstat_writer.pyx":442 * return label_set * * cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable, pywriter_variable_type vartype, str variablename) except *: # <<<<<<<<<<<<<< @@ -10404,7 +10476,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":516 +/* "pyreadstat/_readstat_writer.pyx":520 * raise PyreadstatError(msg) * * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10427,17 +10499,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_variable_alignment", 0); - /* "pyreadstat/_readstat_writer.pyx":523 + /* "pyreadstat/_readstat_writer.pyx":527 * cdef readstat_alignment_t alignment * * if alignment_str == "right": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":524 + /* "pyreadstat/_readstat_writer.pyx":528 * * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT # <<<<<<<<<<<<<< @@ -10446,7 +10518,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_RIGHT; - /* "pyreadstat/_readstat_writer.pyx":523 + /* "pyreadstat/_readstat_writer.pyx":527 * cdef readstat_alignment_t alignment * * if alignment_str == "right": # <<<<<<<<<<<<<< @@ -10456,17 +10528,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":525 + /* "pyreadstat/_readstat_writer.pyx":529 * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 529, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":526 + /* "pyreadstat/_readstat_writer.pyx":530 * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT # <<<<<<<<<<<<<< @@ -10475,7 +10547,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_LEFT; - /* "pyreadstat/_readstat_writer.pyx":525 + /* "pyreadstat/_readstat_writer.pyx":529 * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": # <<<<<<<<<<<<<< @@ -10485,17 +10557,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":527 + /* "pyreadstat/_readstat_writer.pyx":531 * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_center, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_center, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":528 + /* "pyreadstat/_readstat_writer.pyx":532 * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER # <<<<<<<<<<<<<< @@ -10504,7 +10576,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_CENTER; - /* "pyreadstat/_readstat_writer.pyx":527 + /* "pyreadstat/_readstat_writer.pyx":531 * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": # <<<<<<<<<<<<<< @@ -10514,17 +10586,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":529 + /* "pyreadstat/_readstat_writer.pyx":533 * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_UNKNOWN * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 533, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":530 + /* "pyreadstat/_readstat_writer.pyx":534 * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": * alignment = READSTAT_ALIGNMENT_UNKNOWN # <<<<<<<<<<<<<< @@ -10533,7 +10605,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_UNKNOWN; - /* "pyreadstat/_readstat_writer.pyx":529 + /* "pyreadstat/_readstat_writer.pyx":533 * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": # <<<<<<<<<<<<<< @@ -10543,7 +10615,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":532 + /* "pyreadstat/_readstat_writer.pyx":536 * alignment = READSTAT_ALIGNMENT_UNKNOWN * else: * msg = "alignment for variable %s must be either right, center, left or unknown got %s instead" % (var_name, alignment_str) # <<<<<<<<<<<<<< @@ -10551,9 +10623,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads * */ /*else*/ { - __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_alignment_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_alignment_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_alignment_for_variable; __pyx_t_4[1] = __pyx_t_2; @@ -10561,14 +10633,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __pyx_t_4[3] = __pyx_t_3; __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_instead; __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 51 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":533 + /* "pyreadstat/_readstat_writer.pyx":537 * else: * msg = "alignment for variable %s must be either right, center, left or unknown got %s instead" % (var_name, alignment_str) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10576,7 +10648,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads * readstat_variable_set_alignment(variable, alignment) */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10595,16 +10667,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 533, __pyx_L1_error) + __PYX_ERR(0, 537, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":535 + /* "pyreadstat/_readstat_writer.pyx":539 * raise PyreadstatError(msg) * * readstat_variable_set_alignment(variable, alignment) # <<<<<<<<<<<<<< @@ -10613,7 +10685,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ readstat_variable_set_alignment(__pyx_v_variable, __pyx_v_alignment); - /* "pyreadstat/_readstat_writer.pyx":516 + /* "pyreadstat/_readstat_writer.pyx":520 * raise PyreadstatError(msg) * * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10633,7 +10705,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":537 +/* "pyreadstat/_readstat_writer.pyx":541 * readstat_variable_set_alignment(variable, alignment) * * cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: # <<<<<<<<<<<<<< @@ -10643,7 +10715,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(readstat_variable_t *__pyx_v_variable, int __pyx_v_display_width, CYTHON_UNUSED PyObject *__pyx_v_var_name) { - /* "pyreadstat/_readstat_writer.pyx":542 + /* "pyreadstat/_readstat_writer.pyx":546 * """ * * readstat_variable_set_display_width(variable, display_width) # <<<<<<<<<<<<<< @@ -10652,7 +10724,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r */ readstat_variable_set_display_width(__pyx_v_variable, __pyx_v_display_width); - /* "pyreadstat/_readstat_writer.pyx":537 + /* "pyreadstat/_readstat_writer.pyx":541 * readstat_variable_set_alignment(variable, alignment) * * cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: # <<<<<<<<<<<<<< @@ -10663,7 +10735,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r /* function exit code */ } -/* "pyreadstat/_readstat_writer.pyx":544 +/* "pyreadstat/_readstat_writer.pyx":548 * readstat_variable_set_display_width(variable, display_width) * * cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10686,17 +10758,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_variable_measure", 0); - /* "pyreadstat/_readstat_writer.pyx":551 + /* "pyreadstat/_readstat_writer.pyx":555 * cdef readstat_measure_t measure * * if measure_str == "nominal": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_nominal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_nominal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 555, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":552 + /* "pyreadstat/_readstat_writer.pyx":556 * * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL # <<<<<<<<<<<<<< @@ -10705,7 +10777,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_NOMINAL; - /* "pyreadstat/_readstat_writer.pyx":551 + /* "pyreadstat/_readstat_writer.pyx":555 * cdef readstat_measure_t measure * * if measure_str == "nominal": # <<<<<<<<<<<<<< @@ -10715,17 +10787,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":553 + /* "pyreadstat/_readstat_writer.pyx":557 * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_ordinal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_ordinal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":554 + /* "pyreadstat/_readstat_writer.pyx":558 * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL # <<<<<<<<<<<<<< @@ -10734,7 +10806,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_ORDINAL; - /* "pyreadstat/_readstat_writer.pyx":553 + /* "pyreadstat/_readstat_writer.pyx":557 * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": # <<<<<<<<<<<<<< @@ -10744,17 +10816,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":555 + /* "pyreadstat/_readstat_writer.pyx":559 * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_scale, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_scale, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":556 + /* "pyreadstat/_readstat_writer.pyx":560 * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE # <<<<<<<<<<<<<< @@ -10763,7 +10835,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_SCALE; - /* "pyreadstat/_readstat_writer.pyx":555 + /* "pyreadstat/_readstat_writer.pyx":559 * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": # <<<<<<<<<<<<<< @@ -10773,17 +10845,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":557 + /* "pyreadstat/_readstat_writer.pyx":561 * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_UNKNOWN * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":558 + /* "pyreadstat/_readstat_writer.pyx":562 * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": * measure = READSTAT_MEASURE_UNKNOWN # <<<<<<<<<<<<<< @@ -10792,7 +10864,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_UNKNOWN; - /* "pyreadstat/_readstat_writer.pyx":557 + /* "pyreadstat/_readstat_writer.pyx":561 * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": # <<<<<<<<<<<<<< @@ -10802,7 +10874,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":560 + /* "pyreadstat/_readstat_writer.pyx":564 * measure = READSTAT_MEASURE_UNKNOWN * else: * msg = "measure for variable %s must be either nominal, ordinal, scale or unknown got %s instead" % (var_name, measure_str) # <<<<<<<<<<<<<< @@ -10810,9 +10882,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta * */ /*else*/ { - __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_measure_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_measure_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_measure_for_variable; __pyx_t_4[1] = __pyx_t_2; @@ -10820,14 +10892,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __pyx_t_4[3] = __pyx_t_3; __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_instead; __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 55 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":561 + /* "pyreadstat/_readstat_writer.pyx":565 * else: * msg = "measure for variable %s must be either nominal, ordinal, scale or unknown got %s instead" % (var_name, measure_str) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10835,7 +10907,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta * readstat_variable_set_measure(variable, measure); */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10854,16 +10926,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 561, __pyx_L1_error) + __PYX_ERR(0, 565, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":563 + /* "pyreadstat/_readstat_writer.pyx":567 * raise PyreadstatError(msg) * * readstat_variable_set_measure(variable, measure); # <<<<<<<<<<<<<< @@ -10872,7 +10944,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ readstat_variable_set_measure(__pyx_v_variable, __pyx_v_measure); - /* "pyreadstat/_readstat_writer.pyx":544 + /* "pyreadstat/_readstat_writer.pyx":548 * readstat_variable_set_display_width(variable, display_width) * * cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10892,7 +10964,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":566 +/* "pyreadstat/_readstat_writer.pyx":570 * * * cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx) noexcept: # <<<<<<<<<<<<<< @@ -10912,7 +10984,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_bytes", 0); - /* "pyreadstat/_readstat_writer.pyx":571 + /* "pyreadstat/_readstat_writer.pyx":575 * """ * cdef int fd * fd = (ctx)[0] # <<<<<<<<<<<<<< @@ -10921,23 +10993,23 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const */ __pyx_v_fd = (((int *)__pyx_v_ctx)[0]); - /* "pyreadstat/_readstat_writer.pyx":572 + /* "pyreadstat/_readstat_writer.pyx":576 * cdef int fd * fd = (ctx)[0] * if os.name=='nt': # <<<<<<<<<<<<<< * return _write(fd, data, _len) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":573 + /* "pyreadstat/_readstat_writer.pyx":577 * fd = (ctx)[0] * if os.name=='nt': * return _write(fd, data, _len) # <<<<<<<<<<<<<< @@ -10947,7 +11019,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const __pyx_r = _write(__pyx_v_fd, __pyx_v_data, __pyx_v__len); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":572 + /* "pyreadstat/_readstat_writer.pyx":576 * cdef int fd * fd = (ctx)[0] * if os.name=='nt': # <<<<<<<<<<<<<< @@ -10956,19 +11028,19 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const */ } - /* "pyreadstat/_readstat_writer.pyx":575 + /* "pyreadstat/_readstat_writer.pyx":579 * return _write(fd, data, _len) * else: * return write(fd, data, _len) # <<<<<<<<<<<<<< * - * cdef void _check_exit_status(readstat_error_t retcode) except *: + * cdef int open_file(bytes filename_bytes): */ /*else*/ { __pyx_r = write(__pyx_v_fd, __pyx_v_data, __pyx_v__len); goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":566 + /* "pyreadstat/_readstat_writer.pyx":570 * * * cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx) noexcept: # <<<<<<<<<<<<<< @@ -10987,128 +11059,9 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":577 - * return write(fd, data, _len) - * - * cdef void _check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< - * """ - * transforms a readstat exit status to a python error if status is not READSTAT OK -*/ - -static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_error_t __pyx_v_retcode) { - char *__pyx_v_err_readstat; - PyObject *__pyx_v_err_message = 0; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_check_exit_status", 0); - - /* "pyreadstat/_readstat_writer.pyx":584 - * cdef char * err_readstat - * cdef str err_message - * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat -*/ - __pyx_t_1 = (__pyx_v_retcode != READSTAT_OK); - if (unlikely(__pyx_t_1)) { - - /* "pyreadstat/_readstat_writer.pyx":585 - * cdef str err_message - * if retcode != READSTAT_OK: - * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< - * err_message = err_readstat - * raise ReadstatError(err_message) -*/ - __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - - /* "pyreadstat/_readstat_writer.pyx":586 - * if retcode != READSTAT_OK: - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat # <<<<<<<<<<<<<< - * raise ReadstatError(err_message) - * -*/ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_err_message = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/_readstat_writer.pyx":587 - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat - * raise ReadstatError(err_message) # <<<<<<<<<<<<<< - * - * cdef int open_file(bytes filename_bytes): -*/ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_err_message}; - __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 587, __pyx_L1_error) - - /* "pyreadstat/_readstat_writer.pyx":584 - * cdef char * err_readstat - * cdef str err_message - * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat -*/ - } - - /* "pyreadstat/_readstat_writer.pyx":577 +/* "pyreadstat/_readstat_writer.pyx":581 * return write(fd, data, _len) * - * cdef void _check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< - * """ - * transforms a readstat exit status to a python error if status is not READSTAT OK -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("pyreadstat._readstat_writer._check_exit_status", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_err_message); - __Pyx_RefNannyFinishContext(); -} - -/* "pyreadstat/_readstat_writer.pyx":589 - * raise ReadstatError(err_message) - * * cdef int open_file(bytes filename_bytes): # <<<<<<<<<<<<<< * * cdef int fd @@ -11136,23 +11089,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open_file", 0); - /* "pyreadstat/_readstat_writer.pyx":597 + /* "pyreadstat/_readstat_writer.pyx":589 * cdef char *path * * if os.name == "nt": # <<<<<<<<<<<<<< * filename_str = os.fsdecode(filename_bytes) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":598 + /* "pyreadstat/_readstat_writer.pyx":590 * * if os.name == "nt": * filename_str = os.fsdecode(filename_bytes) # <<<<<<<<<<<<<< @@ -11160,9 +11113,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; @@ -11182,23 +11135,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_filename_str = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":599 + /* "pyreadstat/_readstat_writer.pyx":591 * if os.name == "nt": * filename_str = os.fsdecode(filename_bytes) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) # <<<<<<<<<<<<<< * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) */ - __pyx_t_7 = PyUnicode_AsWideCharString(__pyx_v_filename_str, (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_7 = PyUnicode_AsWideCharString(__pyx_v_filename_str, (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 591, __pyx_L1_error) __pyx_v_u16_path = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":600 + /* "pyreadstat/_readstat_writer.pyx":592 * filename_str = os.fsdecode(filename_bytes) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC # <<<<<<<<<<<<<< @@ -11207,7 +11160,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_flags = (((_O_WRONLY | _O_CREAT) | _O_BINARY) | _O_TRUNC); - /* "pyreadstat/_readstat_writer.pyx":601 + /* "pyreadstat/_readstat_writer.pyx":593 * u16_path = PyUnicode_AsWideCharString(filename_str, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) # <<<<<<<<<<<<<< @@ -11216,7 +11169,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, __pyx_v_flags, _SH_DENYRW, (_S_IREAD | _S_IWRITE)); - /* "pyreadstat/_readstat_writer.pyx":597 + /* "pyreadstat/_readstat_writer.pyx":589 * cdef char *path * * if os.name == "nt": # <<<<<<<<<<<<<< @@ -11226,7 +11179,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":603 + /* "pyreadstat/_readstat_writer.pyx":595 * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) * else: * path = filename_bytes # <<<<<<<<<<<<<< @@ -11236,12 +11189,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f /*else*/ { if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 603, __pyx_L1_error) + __PYX_ERR(0, 595, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error) __pyx_v_path = ((char *)__pyx_t_8); - /* "pyreadstat/_readstat_writer.pyx":604 + /* "pyreadstat/_readstat_writer.pyx":596 * else: * path = filename_bytes * flags = O_WRONLY | O_CREAT | O_TRUNC # <<<<<<<<<<<<<< @@ -11250,7 +11203,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_flags = ((O_WRONLY | O_CREAT) | O_TRUNC); - /* "pyreadstat/_readstat_writer.pyx":605 + /* "pyreadstat/_readstat_writer.pyx":597 * path = filename_bytes * flags = O_WRONLY | O_CREAT | O_TRUNC * fd = open(path, flags, 0644) # <<<<<<<<<<<<<< @@ -11261,7 +11214,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":607 + /* "pyreadstat/_readstat_writer.pyx":599 * fd = open(path, flags, 0644) * * return fd # <<<<<<<<<<<<<< @@ -11271,8 +11224,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":589 - * raise ReadstatError(err_message) + /* "pyreadstat/_readstat_writer.pyx":581 + * return write(fd, data, _len) * * cdef int open_file(bytes filename_bytes): # <<<<<<<<<<<<<< * @@ -11293,43 +11246,72 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":609 +/* "pyreadstat/_readstat_writer.pyx":601 * return fd * * cdef int close_file(int fd): # <<<<<<<<<<<<<< - * if os.name == "nt": - * return _close(fd) + * if fd == -1: + * return -1 */ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_file", 0); - /* "pyreadstat/_readstat_writer.pyx":610 + /* "pyreadstat/_readstat_writer.pyx":602 + * + * cdef int close_file(int fd): + * if fd == -1: # <<<<<<<<<<<<<< + * return -1 + * if os.name == "nt": +*/ + __pyx_t_1 = (__pyx_v_fd == -1L); + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_writer.pyx":603 + * cdef int close_file(int fd): + * if fd == -1: + * return -1 # <<<<<<<<<<<<<< + * if os.name == "nt": + * return _close(fd) +*/ + __pyx_r = -1; + goto __pyx_L0; + + /* "pyreadstat/_readstat_writer.pyx":602 * * cdef int close_file(int fd): + * if fd == -1: # <<<<<<<<<<<<<< + * return -1 + * if os.name == "nt": +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":604 + * if fd == -1: + * return -1 * if os.name == "nt": # <<<<<<<<<<<<<< * return _close(fd) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":611 - * cdef int close_file(int fd): + /* "pyreadstat/_readstat_writer.pyx":605 + * return -1 * if os.name == "nt": * return _close(fd) # <<<<<<<<<<<<<< * else: @@ -11338,16 +11320,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { __pyx_r = _close(__pyx_v_fd); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":610 - * - * cdef int close_file(int fd): + /* "pyreadstat/_readstat_writer.pyx":604 + * if fd == -1: + * return -1 * if os.name == "nt": # <<<<<<<<<<<<<< * return _close(fd) * else: */ } - /* "pyreadstat/_readstat_writer.pyx":613 + /* "pyreadstat/_readstat_writer.pyx":607 * return _close(fd) * else: * return close(fd) # <<<<<<<<<<<<<< @@ -11359,18 +11341,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":609 + /* "pyreadstat/_readstat_writer.pyx":601 * return fd * * cdef int close_file(int fd): # <<<<<<<<<<<<<< - * if os.name == "nt": - * return _close(fd) + * if fd == -1: + * return -1 */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyreadstat._readstat_writer.close_file", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -11378,7 +11360,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":615 +/* "pyreadstat/_readstat_writer.pyx":609 * return close(fd) * * cdef void initial_checks(bint is_pandas, bint is_polars, dict variable_value_labels, dict missing_user_values, # <<<<<<<<<<<<<< @@ -11424,7 +11406,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initial_checks", 0); - /* "pyreadstat/_readstat_writer.pyx":621 + /* "pyreadstat/_readstat_writer.pyx":615 * """ * * if not is_pandas and not is_polars: # <<<<<<<<<<<<<< @@ -11442,7 +11424,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":622 + /* "pyreadstat/_readstat_writer.pyx":616 * * if not is_pandas and not is_polars: * msg = "dataframe must be pandas or polars dataframe" # <<<<<<<<<<<<<< @@ -11452,7 +11434,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dataframe_must_be_pandas_or_pola); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_dataframe_must_be_pandas_or_pola; - /* "pyreadstat/_readstat_writer.pyx":623 + /* "pyreadstat/_readstat_writer.pyx":617 * if not is_pandas and not is_polars: * msg = "dataframe must be pandas or polars dataframe" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -11460,7 +11442,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * if variable_value_labels: */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -11479,14 +11461,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 623, __pyx_L1_error) + __PYX_ERR(0, 617, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":621 + /* "pyreadstat/_readstat_writer.pyx":615 * """ * * if not is_pandas and not is_polars: # <<<<<<<<<<<<<< @@ -11495,17 +11477,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":625 + /* "pyreadstat/_readstat_writer.pyx":619 * raise PyreadstatError(msg) * * if variable_value_labels: # <<<<<<<<<<<<<< * for k,v in variable_value_labels.items(): * if type(v) != dict: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 619, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":626 + /* "pyreadstat/_readstat_writer.pyx":620 * * if variable_value_labels: * for k,v in variable_value_labels.items(): # <<<<<<<<<<<<<< @@ -11514,18 +11496,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 620, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_variable_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_variable_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11534,7 +11516,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 620, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11544,7 +11526,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 620, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11555,13 +11537,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 620, __pyx_L1_error) PyErr_Clear(); } break; @@ -11574,7 +11556,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 620, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11584,22 +11566,22 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -11607,7 +11589,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 626, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 620, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10_unpacking_done; @@ -11615,7 +11597,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 620, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4); @@ -11623,42 +11605,42 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":627 + /* "pyreadstat/_readstat_writer.pyx":621 * if variable_value_labels: * for k,v in variable_value_labels.items(): * if type(v) != dict: # <<<<<<<<<<<<<< * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) * raise PyreadstatError(msg) */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":628 + /* "pyreadstat/_readstat_writer.pyx":622 * for k,v in variable_value_labels.items(): * if type(v) != dict: * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_k), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_k), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_v))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_v))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_value_for; __pyx_t_12[1] = __pyx_t_3; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_must_be_dict_got; __pyx_t_12[3] = __pyx_t_9; __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_12, 4, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":629 + /* "pyreadstat/_readstat_writer.pyx":623 * if type(v) != dict: * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -11666,7 +11648,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * cdef list valid_user_missing */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -11685,14 +11667,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 629, __pyx_L1_error) + __PYX_ERR(0, 623, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":627 + /* "pyreadstat/_readstat_writer.pyx":621 * if variable_value_labels: * for k,v in variable_value_labels.items(): * if type(v) != dict: # <<<<<<<<<<<<<< @@ -11701,7 +11683,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":626 + /* "pyreadstat/_readstat_writer.pyx":620 * * if variable_value_labels: * for k,v in variable_value_labels.items(): # <<<<<<<<<<<<<< @@ -11711,7 +11693,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":625 + /* "pyreadstat/_readstat_writer.pyx":619 * raise PyreadstatError(msg) * * if variable_value_labels: # <<<<<<<<<<<<<< @@ -11720,17 +11702,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":632 + /* "pyreadstat/_readstat_writer.pyx":626 * * cdef list valid_user_missing * if missing_user_values: # <<<<<<<<<<<<<< * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 626, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":633 + /* "pyreadstat/_readstat_writer.pyx":627 * cdef list valid_user_missing * if missing_user_values: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -11740,7 +11722,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA: - /* "pyreadstat/_readstat_writer.pyx":634 + /* "pyreadstat/_readstat_writer.pyx":628 * if missing_user_values: * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata # <<<<<<<<<<<<<< @@ -11749,11 +11731,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ __pyx_t_5 = __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 634, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 628, __pyx_L1_error) __pyx_v_valid_user_missing = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":633 + /* "pyreadstat/_readstat_writer.pyx":627 * cdef list valid_user_missing * if missing_user_values: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -11763,7 +11745,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT: - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":629 * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata * elif file_format == FILE_FORMAT_SAS7BDAT or file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -11772,7 +11754,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT: - /* "pyreadstat/_readstat_writer.pyx":636 + /* "pyreadstat/_readstat_writer.pyx":630 * valid_user_missing = valid_user_missing_stata * elif file_format == FILE_FORMAT_SAS7BDAT or file_format == FILE_FORMAT_SAS7BCAT: * valid_user_missing = valid_user_missing_sas # <<<<<<<<<<<<<< @@ -11781,11 +11763,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ __pyx_t_5 = __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 636, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 630, __pyx_L1_error) __pyx_v_valid_user_missing = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":629 * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata * elif file_format == FILE_FORMAT_SAS7BDAT or file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -11796,7 +11778,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i default: break; } - /* "pyreadstat/_readstat_writer.pyx":638 + /* "pyreadstat/_readstat_writer.pyx":632 * valid_user_missing = valid_user_missing_sas * * for key, missing_values in missing_user_values.items(): # <<<<<<<<<<<<<< @@ -11805,18 +11787,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 632, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyDict_Items(__pyx_v_missing_user_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_Items(__pyx_v_missing_user_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 632, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -11825,7 +11807,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 632, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11835,7 +11817,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 632, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11846,13 +11828,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 632, __pyx_L1_error) PyErr_Clear(); } break; @@ -11865,7 +11847,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 632, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11875,22 +11857,22 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -11898,7 +11880,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 638, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 632, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L17_unpacking_done; @@ -11906,7 +11888,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 632, __pyx_L1_error) __pyx_L17_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); @@ -11914,7 +11896,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF_SET(__pyx_v_missing_values, __pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":633 * * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): # <<<<<<<<<<<<<< @@ -11925,7 +11907,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":640 + /* "pyreadstat/_readstat_writer.pyx":634 * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): * msg = "missing_user_values: values in dictionary must be list" # <<<<<<<<<<<<<< @@ -11935,7 +11917,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_user_values_values_in_di); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_user_values_values_in_di; - /* "pyreadstat/_readstat_writer.pyx":641 + /* "pyreadstat/_readstat_writer.pyx":635 * if not isinstance(missing_values, list): * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -11943,7 +11925,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * if val not in valid_user_missing: */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -11962,14 +11944,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 641, __pyx_L1_error) + __PYX_ERR(0, 635, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":633 * * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): # <<<<<<<<<<<<<< @@ -11978,7 +11960,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":636 * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) * for val in missing_values: # <<<<<<<<<<<<<< @@ -11990,9 +11972,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_missing_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_missing_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 636, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -12000,7 +11982,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 636, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -12010,7 +11992,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 636, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -12021,13 +12003,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 636, __pyx_L1_error) PyErr_Clear(); } break; @@ -12037,33 +12019,33 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":643 + /* "pyreadstat/_readstat_writer.pyx":637 * raise PyreadstatError(msg) * for val in missing_values: * if val not in valid_user_missing: # <<<<<<<<<<<<<< * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) * raise PyreadstatError(msg) */ - if (unlikely(!__pyx_v_valid_user_missing)) { __Pyx_RaiseUnboundLocalError("valid_user_missing"); __PYX_ERR(0, 643, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_valid_user_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_v_valid_user_missing)) { __Pyx_RaiseUnboundLocalError("valid_user_missing"); __PYX_ERR(0, 637, __pyx_L1_error) } + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_valid_user_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 637, __pyx_L1_error) if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":644 + /* "pyreadstat/_readstat_writer.pyx":638 * for val in missing_values: * if val not in valid_user_missing: * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_supports_val, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_supports_val, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":645 + /* "pyreadstat/_readstat_writer.pyx":639 * if val not in valid_user_missing: * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -12071,7 +12053,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * if len(col_names) != len(set(col_names)): */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12090,14 +12072,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 645, __pyx_L1_error) + __PYX_ERR(0, 639, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":643 + /* "pyreadstat/_readstat_writer.pyx":637 * raise PyreadstatError(msg) * for val in missing_values: * if val not in valid_user_missing: # <<<<<<<<<<<<<< @@ -12106,7 +12088,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":636 * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) * for val in missing_values: # <<<<<<<<<<<<<< @@ -12116,7 +12098,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":638 + /* "pyreadstat/_readstat_writer.pyx":632 * valid_user_missing = valid_user_missing_sas * * for key, missing_values in missing_user_values.items(): # <<<<<<<<<<<<<< @@ -12126,7 +12108,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":632 + /* "pyreadstat/_readstat_writer.pyx":626 * * cdef list valid_user_missing * if missing_user_values: # <<<<<<<<<<<<<< @@ -12135,7 +12117,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":647 + /* "pyreadstat/_readstat_writer.pyx":641 * raise PyreadstatError(msg) * * if len(col_names) != len(set(col_names)): # <<<<<<<<<<<<<< @@ -12144,17 +12126,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 647, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_t_4 = PySet_New(__pyx_v_col_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = PySet_New(__pyx_v_col_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PySet_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_13 = __Pyx_PySet_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_7 != __pyx_t_13); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":648 + /* "pyreadstat/_readstat_writer.pyx":642 * * if len(col_names) != len(set(col_names)): * msg = "Non unique column names detected in the dataframe!" # <<<<<<<<<<<<<< @@ -12164,7 +12146,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Non_unique_column_names_detected); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_Non_unique_column_names_detected; - /* "pyreadstat/_readstat_writer.pyx":649 + /* "pyreadstat/_readstat_writer.pyx":643 * if len(col_names) != len(set(col_names)): * msg = "Non unique column names detected in the dataframe!" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -12172,7 +12154,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * for variable_name in col_names: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12191,14 +12173,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 649, __pyx_L1_error) + __PYX_ERR(0, 643, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":647 + /* "pyreadstat/_readstat_writer.pyx":641 * raise PyreadstatError(msg) * * if len(col_names) != len(set(col_names)): # <<<<<<<<<<<<<< @@ -12207,7 +12189,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":651 + /* "pyreadstat/_readstat_writer.pyx":645 * raise PyreadstatError(msg) * * for variable_name in col_names: # <<<<<<<<<<<<<< @@ -12216,7 +12198,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 651, __pyx_L1_error) + __PYX_ERR(0, 645, __pyx_L1_error) } __pyx_t_4 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; @@ -12224,30 +12206,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 651, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 645, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":652 + /* "pyreadstat/_readstat_writer.pyx":646 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if len(variable_name) == 0: */ - __pyx_t_9 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 652, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":653 + /* "pyreadstat/_readstat_writer.pyx":647 * for variable_name in col_names: * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) # <<<<<<<<<<<<<< @@ -12255,11 +12237,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16[0] = __pyx_mstate_global->__pyx_kp_u_variable_name; __pyx_t_16[1] = __pyx_t_3; @@ -12267,7 +12249,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_16[3] = __pyx_t_15; __pyx_t_16[4] = __pyx_mstate_global->__pyx_kp_u_and_it_must_be_str_not_starting; __pyx_t_17 = __Pyx_PyUnicode_Join(__pyx_t_16, 5, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 48, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15)); - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -12289,14 +12271,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 653, __pyx_L1_error) + __PYX_ERR(0, 647, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":652 + /* "pyreadstat/_readstat_writer.pyx":646 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< @@ -12305,26 +12287,26 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":654 + /* "pyreadstat/_readstat_writer.pyx":648 * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if len(variable_name) == 0: # <<<<<<<<<<<<<< * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): */ - __pyx_t_7 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 648, __pyx_L1_error) __pyx_t_2 = (__pyx_t_7 == 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":655 + /* "pyreadstat/_readstat_writer.pyx":649 * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if len(variable_name) == 0: * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") # <<<<<<<<<<<<<< - * if not variable_name[0].isalpha(): - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) */ __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12343,30 +12325,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 655, __pyx_L1_error) + __PYX_ERR(0, 649, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":654 + /* "pyreadstat/_readstat_writer.pyx":648 * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if len(variable_name) == 0: # <<<<<<<<<<<<<< * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): */ } - /* "pyreadstat/_readstat_writer.pyx":656 + /* "pyreadstat/_readstat_writer.pyx":650 * if len(variable_name) == 0: * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): # <<<<<<<<<<<<<< - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): # <<<<<<<<<<<<<< + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_17 = __pyx_t_10; __Pyx_INCREF(__pyx_t_17); @@ -12376,46 +12358,57 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isalpha, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L30_bool_binop_done; + } + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_1; + __pyx_L30_bool_binop_done:; __pyx_t_1 = (!__pyx_t_2); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":657 + /* "pyreadstat/_readstat_writer.pyx":651 * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) # <<<<<<<<<<<<<< + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) # <<<<<<<<<<<<<< * if " " in variable_name: * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) */ __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_15), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_15), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = __Pyx_PyObject_Ord(__pyx_t_15); if (unlikely(__pyx_t_18 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_Ord(__pyx_t_15); if (unlikely(__pyx_t_18 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyUnicode_From_long(__pyx_t_18, 0, ' ', 'd'); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyUnicode_From_long(__pyx_t_18, 0, ' ', 'd'); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_19[0] = __pyx_mstate_global->__pyx_kp_u_variable_name; __pyx_t_19[1] = __pyx_t_5; - __pyx_t_19[2] = __pyx_mstate_global->__pyx_kp_u_starts_with_an_illegal_non_alph; + __pyx_t_19[2] = __pyx_mstate_global->__pyx_kp_u_starts_with_an_illegal_neither; __pyx_t_19[3] = __pyx_t_3; __pyx_t_19[4] = __pyx_mstate_global->__pyx_kp_u_ordinal_2; __pyx_t_19[5] = __pyx_t_15; - __pyx_t_19[6] = __pyx_mstate_global->__pyx_kp_u_; - __pyx_t_20 = __Pyx_PyUnicode_Join(__pyx_t_19, 7, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 54 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_19[6] = __pyx_mstate_global->__pyx_kp_u__2; + __pyx_t_20 = __Pyx_PyUnicode_Join(__pyx_t_19, 7, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 76 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12438,43 +12431,43 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 657, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 657, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":656 + /* "pyreadstat/_readstat_writer.pyx":650 * if len(variable_name) == 0: * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): # <<<<<<<<<<<<<< - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): # <<<<<<<<<<<<<< + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: */ } - /* "pyreadstat/_readstat_writer.pyx":658 - * if not variable_name[0].isalpha(): - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + /* "pyreadstat/_readstat_writer.pyx":652 + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__2, __pyx_v_variable_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__3, __pyx_v_variable_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":659 - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + /* "pyreadstat/_readstat_writer.pyx":653 + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) # <<<<<<<<<<<<<< * * dirname = os.path.dirname(filename_bytes) */ __pyx_t_17 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12494,23 +12487,23 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 659, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 659, __pyx_L1_error) + __PYX_ERR(0, 653, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":658 - * if not variable_name[0].isalpha(): - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + /* "pyreadstat/_readstat_writer.pyx":652 + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * */ } - /* "pyreadstat/_readstat_writer.pyx":651 + /* "pyreadstat/_readstat_writer.pyx":645 * raise PyreadstatError(msg) * * for variable_name in col_names: # <<<<<<<<<<<<<< @@ -12520,16 +12513,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":661 + /* "pyreadstat/_readstat_writer.pyx":655 * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * * dirname = os.path.dirname(filename_bytes) # <<<<<<<<<<<<<< * if dirname and not os.path.isdir(dirname): * raise PyreadstatError(f"the destination folder {dirname} does not exist!") */ - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_9 = __pyx_t_10; @@ -12540,28 +12533,28 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dirname, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_dirname = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":662 + /* "pyreadstat/_readstat_writer.pyx":656 * * dirname = os.path.dirname(filename_bytes) * if dirname and not os.path.isdir(dirname): # <<<<<<<<<<<<<< * raise PyreadstatError(f"the destination folder {dirname} does not exist!") * */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dirname); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dirname); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L33_bool_binop_done; + goto __pyx_L35_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = __pyx_t_20; @@ -12572,17 +12565,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isdir, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_21 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_21; - __pyx_L33_bool_binop_done:; + __pyx_L35_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":663 + /* "pyreadstat/_readstat_writer.pyx":657 * dirname = os.path.dirname(filename_bytes) * if dirname and not os.path.isdir(dirname): * raise PyreadstatError(f"the destination folder {dirname} does not exist!") # <<<<<<<<<<<<<< @@ -12590,15 +12583,15 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * cdef bytes filepath_to_bytes(object filename_path): */ __pyx_t_20 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_dirname, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_dirname, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_22[0] = __pyx_mstate_global->__pyx_kp_u_the_destination_folder; __pyx_t_22[1] = __pyx_t_9; __pyx_t_22[2] = __pyx_mstate_global->__pyx_kp_u_does_not_exist; __pyx_t_17 = __Pyx_PyUnicode_Join(__pyx_t_22, 3, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 16, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 663, __pyx_L1_error) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = 1; @@ -12619,14 +12612,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 657, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":662 + /* "pyreadstat/_readstat_writer.pyx":656 * * dirname = os.path.dirname(filename_bytes) * if dirname and not os.path.isdir(dirname): # <<<<<<<<<<<<<< @@ -12635,7 +12628,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":615 + /* "pyreadstat/_readstat_writer.pyx":609 * return close(fd) * * cdef void initial_checks(bint is_pandas, bint is_polars, dict variable_value_labels, dict missing_user_values, # <<<<<<<<<<<<<< @@ -12668,7 +12661,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":665 +/* "pyreadstat/_readstat_writer.pyx":659 * raise PyreadstatError(f"the destination folder {dirname} does not exist!") * * cdef bytes filepath_to_bytes(object filename_path): # <<<<<<<<<<<<<< @@ -12701,20 +12694,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filepath_to_bytes", 0); - /* "pyreadstat/_readstat_writer.pyx":669 + /* "pyreadstat/_readstat_writer.pyx":663 * transforms an object with the path to the filename to bytes * """ * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_bytes = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":664 * """ * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -12730,7 +12723,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "pyreadstat/_readstat_writer.pyx":671 + /* "pyreadstat/_readstat_writer.pyx":665 * if hasattr(os, 'fsencode'): * try: * filename_bytes = os.fsencode(filename_path) # <<<<<<<<<<<<<< @@ -12738,9 +12731,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) */ __pyx_t_6 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L4_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 665, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L4_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; @@ -12760,13 +12753,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L4_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_filename_bytes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":664 * """ * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -12784,7 +12777,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":672 + /* "pyreadstat/_readstat_writer.pyx":666 * try: * filename_bytes = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -12794,12 +12787,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_UnicodeError)))); if (__pyx_t_10) { __Pyx_AddTraceback("pyreadstat._readstat_writer.filepath_to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 672, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 666, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); - /* "pyreadstat/_readstat_writer.pyx":673 + /* "pyreadstat/_readstat_writer.pyx":667 * filename_bytes = os.fsencode(filename_path) * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) # <<<<<<<<<<<<<< @@ -12807,15 +12800,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * else: */ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_9 = 1; @@ -12835,10 +12828,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 673, __pyx_L6_except_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_16 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __pyx_t_16 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = 1; @@ -12859,12 +12852,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 673, __pyx_L6_except_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":674 + /* "pyreadstat/_readstat_writer.pyx":668 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< @@ -12872,9 +12865,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * if type(filename_path) == str: */ __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 668, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 668, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_9 = 1; @@ -12894,13 +12887,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L6_except_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 668, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_filename_bytes, __pyx_t_7); @@ -12912,7 +12905,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj } goto __pyx_L6_except_error; - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":664 * """ * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -12933,7 +12926,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_L9_try_end:; } - /* "pyreadstat/_readstat_writer.pyx":669 + /* "pyreadstat/_readstat_writer.pyx":663 * transforms an object with the path to the filename to bytes * """ * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< @@ -12943,7 +12936,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":670 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -12951,12 +12944,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":677 + /* "pyreadstat/_readstat_writer.pyx":671 * else: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -12970,13 +12963,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_v_filename_bytes = __pyx_t_6; __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":670 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -12986,19 +12979,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj goto __pyx_L12; } - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":672 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":679 + /* "pyreadstat/_readstat_writer.pyx":673 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< @@ -13008,7 +13001,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_INCREF(__pyx_v_filename_path); __pyx_v_filename_bytes = __pyx_v_filename_path; - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":672 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< @@ -13018,7 +13011,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj goto __pyx_L12; } - /* "pyreadstat/_readstat_writer.pyx":681 + /* "pyreadstat/_readstat_writer.pyx":675 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -13027,7 +13020,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj */ /*else*/ { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -13046,18 +13039,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 681, __pyx_L1_error) + __PYX_ERR(0, 675, __pyx_L1_error) } __pyx_L12:; } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":682 + /* "pyreadstat/_readstat_writer.pyx":676 * else: * raise PyreadstatError("path must be either str or bytes") * return filename_bytes # <<<<<<<<<<<<<< @@ -13067,12 +13060,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_v_filename_bytes; __Pyx_INCREF(__pyx_t_6); - if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_6))) __PYX_ERR(0, 682, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_6))) __PYX_ERR(0, 676, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":665 + /* "pyreadstat/_readstat_writer.pyx":659 * raise PyreadstatError(f"the destination folder {dirname} does not exist!") * * cdef bytes filepath_to_bytes(object filename_path): # <<<<<<<<<<<<<< @@ -13101,7 +13094,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":685 +/* "pyreadstat/_readstat_writer.pyx":679 * * * cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, # <<<<<<<<<<<<<< @@ -13109,7 +13102,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * dict missing_ranges, dict missing_user_values, dict variable_alignment, */ -static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_df, PyObject *__pyx_v_filename_path, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_v_file_format, PyObject *__pyx_v_file_label, PyObject *__pyx_v_column_labels, int __pyx_v_file_format_version, PyObject *__pyx_v_note, PyObject *__pyx_v_table_name, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_alignment, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_variable_format, int __pyx_v_row_compression) { +static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_df, PyObject *__pyx_v_filename_path, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_v_file_format, PyObject *__pyx_v_file_label, PyObject *__pyx_v_column_labels, int __pyx_v_file_format_version, PyObject *__pyx_v_note, PyObject *__pyx_v_table_name, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_alignment, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_informat, int __pyx_v_row_compression) { PyObject *__pyx_v_natnamespace = 0; PyObject *__pyx_v_pd = 0; int __pyx_v_is_pandas; @@ -13185,30 +13178,33 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_14[7]; PyObject *__pyx_t_15 = NULL; - char *__pyx_t_16; - char const *__pyx_t_17; - int __pyx_t_18; - int __pyx_t_19; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + char *__pyx_t_18; + char const *__pyx_t_19; int __pyx_t_20; int __pyx_t_21; - __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type __pyx_t_22; + int __pyx_t_22; int __pyx_t_23; - char const *__pyx_t_24; - readstat_type_t __pyx_t_25; + __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type __pyx_t_24; + int __pyx_t_25; char const *__pyx_t_26; - char const *__pyx_t_27; + readstat_type_t __pyx_t_27; char const *__pyx_t_28; - readstat_label_set_t *__pyx_t_29; - long __pyx_t_30; - double __pyx_t_31; - int32_t __pyx_t_32; - char const *__pyx_t_33; - char const *__pyx_t_34; - PyObject *__pyx_t_35 = NULL; - PyObject *__pyx_t_36 = NULL; - PyObject *__pyx_t_37 = NULL; + char const *__pyx_t_29; + char const *__pyx_t_30; + char const *__pyx_t_31; + readstat_label_set_t *__pyx_t_32; + long __pyx_t_33; + double __pyx_t_34; + int32_t __pyx_t_35; + char const *__pyx_t_36; + char const *__pyx_t_37; + PyObject *__pyx_t_38 = NULL; + PyObject *__pyx_t_39 = NULL; + PyObject *__pyx_t_40 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -13217,7 +13213,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_column_labels); __Pyx_INCREF(__pyx_v_note); - /* "pyreadstat/_readstat_writer.pyx":696 + /* "pyreadstat/_readstat_writer.pyx":691 * * cdef object natnamespace * cdef object pd = None # <<<<<<<<<<<<<< @@ -13227,28 +13223,28 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __pyx_v_pd = Py_None; - /* "pyreadstat/_readstat_writer.pyx":701 + /* "pyreadstat/_readstat_writer.pyx":696 * cdef list col_names * * filename_bytes = filepath_to_bytes(filename_path) # <<<<<<<<<<<<<< * filename_bytes = os.path.expanduser(filename_bytes) * */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(__pyx_v_filename_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(__pyx_v_filename_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_filename_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":702 + /* "pyreadstat/_readstat_writer.pyx":697 * * filename_bytes = filepath_to_bytes(filename_path) * filename_bytes = os.path.expanduser(filename_bytes) # <<<<<<<<<<<<<< * * df = nw.from_native(df, eager_only=True) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; @@ -13259,14 +13255,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_expanduser, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 702, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":704 + /* "pyreadstat/_readstat_writer.pyx":699 * filename_bytes = os.path.expanduser(filename_bytes) * * df = nw.from_native(df, eager_only=True) # <<<<<<<<<<<<<< @@ -13274,9 +13270,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * is_pandas = df.implementation.is_pandas() */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_from_native); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_from_native); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 1; @@ -13293,20 +13289,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_df}; - __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eager_only, Py_True, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 704, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eager_only, Py_True, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 699, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":705 + /* "pyreadstat/_readstat_writer.pyx":700 * * df = nw.from_native(df, eager_only=True) * natnamespace = nw.get_native_namespace(df) # <<<<<<<<<<<<<< @@ -13314,9 +13310,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * is_polars = df.implementation.is_polars() */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 1; @@ -13336,20 +13332,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_natnamespace = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":706 + /* "pyreadstat/_readstat_writer.pyx":701 * df = nw.from_native(df, eager_only=True) * natnamespace = nw.get_native_namespace(df) * is_pandas = df.implementation.is_pandas() # <<<<<<<<<<<<<< * is_polars = df.implementation.is_polars() * col_names = df.columns */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); @@ -13359,21 +13355,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_pandas, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_pandas = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":707 + /* "pyreadstat/_readstat_writer.pyx":702 * natnamespace = nw.get_native_namespace(df) * is_pandas = df.implementation.is_pandas() * is_polars = df.implementation.is_polars() # <<<<<<<<<<<<<< * col_names = df.columns * if is_pandas: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); @@ -13383,27 +13379,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_polars, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_polars = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":708 + /* "pyreadstat/_readstat_writer.pyx":703 * is_pandas = df.implementation.is_pandas() * is_polars = df.implementation.is_polars() * col_names = df.columns # <<<<<<<<<<<<<< * if is_pandas: * pd = natnamespace */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 708, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 703, __pyx_L1_error) __pyx_v_col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":709 + /* "pyreadstat/_readstat_writer.pyx":704 * is_polars = df.implementation.is_polars() * col_names = df.columns * if is_pandas: # <<<<<<<<<<<<<< @@ -13412,7 +13408,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_is_pandas) { - /* "pyreadstat/_readstat_writer.pyx":710 + /* "pyreadstat/_readstat_writer.pyx":705 * col_names = df.columns * if is_pandas: * pd = natnamespace # <<<<<<<<<<<<<< @@ -13422,7 +13418,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_natnamespace); __Pyx_DECREF_SET(__pyx_v_pd, __pyx_v_natnamespace); - /* "pyreadstat/_readstat_writer.pyx":709 + /* "pyreadstat/_readstat_writer.pyx":704 * is_polars = df.implementation.is_polars() * col_names = df.columns * if is_pandas: # <<<<<<<<<<<<<< @@ -13431,16 +13427,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":712 + /* "pyreadstat/_readstat_writer.pyx":707 * pd = natnamespace * * initial_checks(is_pandas, is_polars, variable_value_labels, missing_user_values, file_format, # <<<<<<<<<<<<<< * col_names, filename_bytes) * */ - __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(__pyx_v_is_pandas, __pyx_v_is_polars, __pyx_v_variable_value_labels, __pyx_v_missing_user_values, __pyx_v_file_format, __pyx_v_col_names, __pyx_v_filename_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(__pyx_v_is_pandas, __pyx_v_is_polars, __pyx_v_variable_value_labels, __pyx_v_missing_user_values, __pyx_v_file_format, __pyx_v_col_names, __pyx_v_filename_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":723 + /* "pyreadstat/_readstat_writer.pyx":718 * cdef bytes file_label_bytes * cdef char *file_labl * cdef int dta_str_max_len = 0 # <<<<<<<<<<<<<< @@ -13449,7 +13445,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_dta_str_max_len = 0; - /* "pyreadstat/_readstat_writer.pyx":726 + /* "pyreadstat/_readstat_writer.pyx":721 * * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -13459,18 +13455,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":727 + /* "pyreadstat/_readstat_writer.pyx":722 * * if file_format == FILE_FORMAT_POR: * col_names = [x.upper() for x in col_names] # <<<<<<<<<<<<<< * * if file_format == FILE_FORMAT_DTA: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 727, __pyx_L1_error) + __PYX_ERR(0, 722, __pyx_L1_error) } __pyx_t_4 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; @@ -13478,13 +13474,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; @@ -13495,17 +13491,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_col_names, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":726 + /* "pyreadstat/_readstat_writer.pyx":721 * * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -13514,7 +13510,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":724 * col_names = [x.upper() for x in col_names] * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -13524,7 +13520,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":725 * * if file_format == FILE_FORMAT_DTA: * if file_format_version >= 117: # <<<<<<<<<<<<<< @@ -13534,7 +13530,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format_version >= 0x75); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":731 + /* "pyreadstat/_readstat_writer.pyx":726 * if file_format == FILE_FORMAT_DTA: * if file_format_version >= 117: * dta_str_max_len = dta_117_max_width # <<<<<<<<<<<<<< @@ -13543,7 +13539,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_dta_str_max_len = __pyx_v_10pyreadstat_16_readstat_writer_dta_117_max_width; - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":725 * * if file_format == FILE_FORMAT_DTA: * if file_format_version >= 117: # <<<<<<<<<<<<<< @@ -13553,7 +13549,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":727 * if file_format_version >= 117: * dta_str_max_len = dta_117_max_width * elif file_format_version >= 111: # <<<<<<<<<<<<<< @@ -13563,7 +13559,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format_version >= 0x6F); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":733 + /* "pyreadstat/_readstat_writer.pyx":728 * dta_str_max_len = dta_117_max_width * elif file_format_version >= 111: * dta_str_max_len = dta_111_max_width # <<<<<<<<<<<<<< @@ -13572,7 +13568,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_dta_str_max_len = __pyx_v_10pyreadstat_16_readstat_writer_dta_111_max_width; - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":727 * if file_format_version >= 117: * dta_str_max_len = dta_117_max_width * elif file_format_version >= 111: # <<<<<<<<<<<<<< @@ -13582,7 +13578,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":735 + /* "pyreadstat/_readstat_writer.pyx":730 * dta_str_max_len = dta_111_max_width * else: * dta_str_max_len = dta_old_max_width # <<<<<<<<<<<<<< @@ -13594,7 +13590,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_L9:; - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":724 * col_names = [x.upper() for x in col_names] * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -13603,29 +13599,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":737 + /* "pyreadstat/_readstat_writer.pyx":732 * dta_str_max_len = dta_old_max_width * * cdef list col_types = get_narwhals_column_types(df, missing_user_values, variable_value_labels, dta_str_max_len) # <<<<<<<<<<<<<< * cdef int row_count = len(df) * cdef int col_count = len(col_names) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types(__pyx_v_df, __pyx_v_missing_user_values, __pyx_v_variable_value_labels, __pyx_v_dta_str_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types(__pyx_v_df, __pyx_v_missing_user_values, __pyx_v_variable_value_labels, __pyx_v_dta_str_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":738 + /* "pyreadstat/_readstat_writer.pyx":733 * * cdef list col_types = get_narwhals_column_types(df, missing_user_values, variable_value_labels, dta_str_max_len) * cdef int row_count = len(df) # <<<<<<<<<<<<<< * cdef int col_count = len(col_names) * cdef dict col_names_to_types = {k:v[0] for k,v in zip(col_names, col_types)} */ - __pyx_t_7 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 733, __pyx_L1_error) __pyx_v_row_count = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":739 + /* "pyreadstat/_readstat_writer.pyx":734 * cdef list col_types = get_narwhals_column_types(df, missing_user_values, variable_value_labels, dta_str_max_len) * cdef int row_count = len(df) * cdef int col_count = len(col_names) # <<<<<<<<<<<<<< @@ -13634,12 +13630,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 739, __pyx_L1_error) + __PYX_ERR(0, 734, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 734, __pyx_L1_error) __pyx_v_col_count = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":740 + /* "pyreadstat/_readstat_writer.pyx":735 * cdef int row_count = len(df) * cdef int col_count = len(col_names) * cdef dict col_names_to_types = {k:v[0] for k,v in zip(col_names, col_types)} # <<<<<<<<<<<<<< @@ -13647,7 +13643,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * cdef readstat_variable_t *variable */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_5 = 1; @@ -13655,7 +13651,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_col_names, __pyx_v_col_types}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -13663,9 +13659,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -13674,7 +13670,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __pyx_L12_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -13684,7 +13680,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __pyx_L12_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -13695,13 +13691,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L12_error) } else { __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 735, __pyx_L12_error) PyErr_Clear(); } break; @@ -13714,7 +13710,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 740, __pyx_L12_error) + __PYX_ERR(0, 735, __pyx_L12_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13724,22 +13720,22 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -13747,7 +13743,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 740, __pyx_L12_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 735, __pyx_L12_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L16_unpacking_done; @@ -13755,16 +13751,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 740, __pyx_L12_error) + __PYX_ERR(0, 735, __pyx_L12_error) __pyx_L16_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 735, __pyx_L12_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -13780,7 +13776,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_v_col_names_to_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":749 + /* "pyreadstat/_readstat_writer.pyx":744 * cdef int col_indx * cdef bytes cur_col_label * cdef int col_label_count = 0 # <<<<<<<<<<<<<< @@ -13789,7 +13785,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_col_label_count = 0; - /* "pyreadstat/_readstat_writer.pyx":758 + /* "pyreadstat/_readstat_writer.pyx":753 * cdef object values * cdef dict value_labels * cdef int lblset_cnt = 0 # <<<<<<<<<<<<<< @@ -13798,31 +13794,141 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = 0; - /* "pyreadstat/_readstat_writer.pyx":766 + /* "pyreadstat/_readstat_writer.pyx":761 * cdef float mulfac, conv2secs * cdef readstat_string_ref_t* strref * cdef dict strref_map = dict() # <<<<<<<<<<<<<< * cdef int strref_cnt * cdef object strref_indx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_strref_map = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":771 + /* "pyreadstat/_readstat_writer.pyx":766 * * * cdef int fd = open_file(filename_bytes) # <<<<<<<<<<<<<< + * if fd == -1: + * raise PyreadstatError( +*/ + __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_open_file(__pyx_v_filename_bytes); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L1_error) + __pyx_v_fd = __pyx_t_12; + + /* "pyreadstat/_readstat_writer.pyx":767 + * + * cdef int fd = open_file(filename_bytes) + * if fd == -1: # <<<<<<<<<<<<<< + * raise PyreadstatError( + * "Could not open file '%s' for writing: %s (errno %d). " +*/ + __pyx_t_6 = (__pyx_v_fd == -1L); + if (unlikely(__pyx_t_6)) { + + /* "pyreadstat/_readstat_writer.pyx":768 + * cdef int fd = open_file(filename_bytes) + * if fd == -1: + * raise PyreadstatError( # <<<<<<<<<<<<<< + * "Could not open file '%s' for writing: %s (errno %d). " + * "The file may be locked by another process or you may not have write permission." +*/ + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "pyreadstat/_readstat_writer.pyx":771 + * "Could not open file '%s' for writing: %s (errno %d). " + * "The file may be locked by another process or you may not have write permission." + * % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) # <<<<<<<<<<<<<< * writer = readstat_writer_init() * */ - __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_open_file(__pyx_v_filename_bytes); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error) - __pyx_v_fd = __pyx_t_12; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename_bytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_9), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_strerror); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyLong_From_int(errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_13), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyUnicode_From_int(errno, 0, ' ', 'd'); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_Could_not_open_file; + __pyx_t_14[1] = __pyx_t_2; + __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_for_writing; + __pyx_t_14[3] = __pyx_t_9; + __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u_errno; + __pyx_t_14[5] = __pyx_t_13; + __pyx_t_14[6] = __pyx_mstate_global->__pyx_kp_u_The_file_may_be_locked_by_anoth; + + /* "pyreadstat/_readstat_writer.pyx":769 + * if fd == -1: + * raise PyreadstatError( + * "Could not open file '%s' for writing: %s (errno %d). " # <<<<<<<<<<<<<< + * "The file may be locked by another process or you may not have write permission." + * % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) +*/ + __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_14, 7, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 82, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 768, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":772 + /* "pyreadstat/_readstat_writer.pyx":767 * * cdef int fd = open_file(filename_bytes) + * if fd == -1: # <<<<<<<<<<<<<< + * raise PyreadstatError( + * "Could not open file '%s' for writing: %s (errno %d). " +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":772 + * "The file may be locked by another process or you may not have write permission." + * % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) * writer = readstat_writer_init() # <<<<<<<<<<<<<< * * try: @@ -13840,10 +13946,10 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "pyreadstat/_readstat_writer.pyx":776 @@ -13853,7 +13959,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * if file_label: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_data_writer(__pyx_v_writer, __pyx_f_10pyreadstat_16_readstat_writer_write_bytes)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_data_writer(__pyx_v_writer, __pyx_f_10pyreadstat_16_readstat_writer_write_bytes)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":778 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) @@ -13866,7 +13972,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_file_label); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 778, __pyx_L22_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 778, __pyx_L23_error) __pyx_t_6 = (__pyx_temp != 0); } @@ -13881,9 +13987,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_file_label == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 779, __pyx_L22_error) + __PYX_ERR(0, 779, __pyx_L23_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_file_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_file_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_file_label_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -13895,8 +14001,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * */ - __pyx_t_16 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L22_error) - __pyx_v_file_labl = ((char *)__pyx_t_16); + __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L23_error) + __pyx_v_file_labl = ((char *)__pyx_t_18); /* "pyreadstat/_readstat_writer.pyx":781 * file_label_bytes = file_label.encode("utf-8") @@ -13905,7 +14011,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * if note: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_label(__pyx_v_writer, __pyx_v_file_labl)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_label(__pyx_v_writer, __pyx_v_file_labl)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":778 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) @@ -13923,7 +14029,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if type(note) == str: * note = [note] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 783, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 783, __pyx_L23_error) if (__pyx_t_6) { /* "pyreadstat/_readstat_writer.pyx":784 @@ -13933,8 +14039,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * note = [note] * if type(note) == list: */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L22_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 784, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L23_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 784, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -13945,11 +14051,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if type(note) == list: * for line in note: */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L22_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_note); __Pyx_GIVEREF(__pyx_v_note); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_note) != (0)) __PYX_ERR(0, 785, __pyx_L22_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_note) != (0)) __PYX_ERR(0, 785, __pyx_L23_error); __Pyx_DECREF_SET(__pyx_v_note, __pyx_t_1); __pyx_t_1 = 0; @@ -13969,8 +14075,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * for line in note: * readstat_add_note(writer, line.encode("utf-8")) */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L22_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 786, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L23_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 786, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_6)) { @@ -13986,9 +14092,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L22_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 787, __pyx_L22_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 787, __pyx_L23_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -13996,42 +14102,42 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 787, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 787, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L23_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 787, __pyx_L23_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_4); + __pyx_t_4 = 0; /* "pyreadstat/_readstat_writer.pyx":788 * if type(note) == list: @@ -14040,19 +14146,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * else: * raise PyreadstatError(f"note should be either str or list, got {type(note)}") */ - __pyx_t_4 = __pyx_v_line; - __Pyx_INCREF(__pyx_t_4); + __pyx_t_10 = __pyx_v_line; + __Pyx_INCREF(__pyx_t_10); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_utf_8}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_utf_8}; + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_17 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L22_error) - readstat_add_note(__pyx_v_writer, __pyx_t_17); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L23_error) + readstat_add_note(__pyx_v_writer, __pyx_t_19); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyreadstat/_readstat_writer.pyx":787 * note = [note] @@ -14071,7 +14177,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * for line in note: * readstat_add_note(writer, line.encode("utf-8")) */ - goto __pyx_L31; + goto __pyx_L32; } /* "pyreadstat/_readstat_writer.pyx":790 @@ -14082,40 +14188,40 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if file_format_version > -1: */ /*else*/ { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_note)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 790, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_note_should_be_either_str_or_lis, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_note)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_note_should_be_either_str_or_lis, __pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 790, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 790, __pyx_L22_error) + __PYX_ERR(0, 790, __pyx_L23_error) } - __pyx_L31:; + __pyx_L32:; /* "pyreadstat/_readstat_writer.pyx":783 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) @@ -14143,7 +14249,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * if row_compression: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_format_version(__pyx_v_writer, __pyx_v_file_format_version)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_format_version(__pyx_v_writer, __pyx_v_file_format_version)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":792 * raise PyreadstatError(f"note should be either str or list, got {type(note)}") @@ -14170,7 +14276,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * # table name is used only for xpt files */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_compression(__pyx_v_writer, READSTAT_COMPRESS_ROWS)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_compression(__pyx_v_writer, READSTAT_COMPRESS_ROWS)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":795 * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) @@ -14192,7 +14298,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_table_name); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 799, __pyx_L22_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 799, __pyx_L23_error) __pyx_t_6 = (__pyx_temp != 0); } @@ -14207,9 +14313,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_table_name == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 800, __pyx_L22_error) + __PYX_ERR(0, 800, __pyx_L23_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_table_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_table_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_table_name_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -14221,8 +14327,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) * */ - __pyx_t_16 = __Pyx_PyBytes_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L22_error) - __pyx_v_tab_name = ((char *)__pyx_t_16); + __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L23_error) + __pyx_v_tab_name = ((char *)__pyx_t_18); /* "pyreadstat/_readstat_writer.pyx":802 * table_name_bytes = table_name.encode("utf-8") @@ -14231,7 +14337,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * # add variables */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_table_name(__pyx_v_writer, __pyx_v_tab_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_table_name(__pyx_v_writer, __pyx_v_tab_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":799 * @@ -14249,7 +14355,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if type(column_labels) != list and type(column_labels) != dict: * raise PyreadstatError("column_labels must be either list or dict!") */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_column_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 805, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_column_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 805, __pyx_L23_error) if (__pyx_t_6) { /* "pyreadstat/_readstat_writer.pyx":806 @@ -14259,19 +14365,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * raise PyreadstatError("column_labels must be either list or dict!") * if type(column_labels) == dict: */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyList_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L22_error) - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 806, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyList_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L23_error) + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 806, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_18) { + if (__pyx_t_20) { } else { - __pyx_t_6 = __pyx_t_18; - goto __pyx_L40_bool_binop_done; + __pyx_t_6 = __pyx_t_20; + goto __pyx_L41_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L22_error) - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 806, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L23_error) + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 806, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_t_18; - __pyx_L40_bool_binop_done:; + __pyx_t_6 = __pyx_t_20; + __pyx_L41_bool_binop_done:; if (unlikely(__pyx_t_6)) { /* "pyreadstat/_readstat_writer.pyx":807 @@ -14281,32 +14387,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if type(column_labels) == dict: * col_label_temp = list() */ - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 807, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13); + assert(__pyx_t_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_column_labels_must_be_either_lis}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_column_labels_must_be_either_lis}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 807, __pyx_L22_error) + __PYX_ERR(0, 807, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":806 * # add variables @@ -14324,8 +14430,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * col_label_temp = list() * for col_indx in range(col_count): */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L22_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 808, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L23_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 808, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -14336,7 +14442,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * for col_indx in range(col_count): * variable_name = col_names[col_indx] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L22_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_label_temp = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -14349,9 +14455,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if variable_name in column_labels.keys(): */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; /* "pyreadstat/_readstat_writer.pyx":811 * col_label_temp = list() @@ -14362,9 +14468,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 811, __pyx_L22_error) + __PYX_ERR(0, 811, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; @@ -14376,17 +14482,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * col_label_temp.append(column_labels[variable_name]) * else: */ - __pyx_t_2 = __pyx_v_column_labels; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_13 = __pyx_v_column_labels; + __Pyx_INCREF(__pyx_t_13); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_keys, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 812, __pyx_L22_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 812, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { @@ -14397,9 +14503,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * else: * col_label_temp.append(None) */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_column_labels, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_column_labels, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_col_label_temp, __pyx_t_1); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 813, __pyx_L22_error) + __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_col_label_temp, __pyx_t_1); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 813, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyreadstat/_readstat_writer.pyx":812 @@ -14409,7 +14515,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * col_label_temp.append(column_labels[variable_name]) * else: */ - goto __pyx_L45; + goto __pyx_L46; } /* "pyreadstat/_readstat_writer.pyx":815 @@ -14420,9 +14526,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * */ /*else*/ { - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_col_label_temp, Py_None); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 815, __pyx_L22_error) + __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_col_label_temp, Py_None); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 815, __pyx_L23_error) } - __pyx_L45:; + __pyx_L46:; } /* "pyreadstat/_readstat_writer.pyx":816 @@ -14451,7 +14557,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if col_label_count != col_count: * raise PyreadstatError("length of column labels must be the same as number of columns") */ - __pyx_t_7 = PyObject_Length(__pyx_v_column_labels); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 818, __pyx_L22_error) + __pyx_t_7 = PyObject_Length(__pyx_v_column_labels); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 818, __pyx_L23_error) __pyx_v_col_label_count = __pyx_t_7; /* "pyreadstat/_readstat_writer.pyx":819 @@ -14471,32 +14577,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * strref_cnt = 0 */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 820, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_13); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_length_of_column_labels_must_be}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_length_of_column_labels_must_be}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 820, __pyx_L22_error) + __PYX_ERR(0, 820, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":819 * @@ -14533,9 +14639,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * variable_name = col_names[col_indx] */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; /* "pyreadstat/_readstat_writer.pyx":824 * strref_cnt = 0 @@ -14546,9 +14652,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 824, __pyx_L22_error) + __PYX_ERR(0, 824, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -14556,38 +14662,38 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 824, __pyx_L22_error) + __PYX_ERR(0, 824, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_13); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_3); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); - __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L22_error) + __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L22_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_XGOTREF(__pyx_t_9); } #else { Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_2,&__pyx_t_3,&__pyx_t_9}; + PyObject** temps[4] = {&__pyx_t_10,&__pyx_t_13,&__pyx_t_4,&__pyx_t_3}; for (i=0; i < 4; i++) { - PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 824, __pyx_L22_error) + PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 824, __pyx_L23_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -14596,37 +14702,37 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_2,&__pyx_t_3,&__pyx_t_9}; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_10); + PyObject** temps[4] = {&__pyx_t_10,&__pyx_t_13,&__pyx_t_4,&__pyx_t_3}; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L49_unpacking_failed; + PyObject* item = __pyx_t_11(__pyx_t_9); if (unlikely(!item)) goto __pyx_L50_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < (0)) __PYX_ERR(0, 824, __pyx_L22_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 4) < (0)) __PYX_ERR(0, 824, __pyx_L23_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L50_unpacking_done; - __pyx_L49_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L51_unpacking_done; + __pyx_L50_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 824, __pyx_L22_error) - __pyx_L50_unpacking_done:; + __PYX_ERR(0, 824, __pyx_L23_error) + __pyx_L51_unpacking_done:; } - __pyx_t_22 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_23 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_curtype = __pyx_t_22; - __pyx_v_max_length = __pyx_t_23; - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3); + __pyx_t_24 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_t_13); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_curtype = __pyx_t_24; + __pyx_v_max_length = __pyx_t_25; + __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v__, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v__, __pyx_t_9); - __pyx_t_9 = 0; /* "pyreadstat/_readstat_writer.pyx":825 * for col_indx in range(col_count): @@ -14637,9 +14743,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 825, __pyx_L22_error) + __PYX_ERR(0, 825, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; @@ -14651,29 +14757,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * # add format * if variable_format: */ - __pyx_t_9 = __pyx_v_variable_name; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_24 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_24) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L22_error) + __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L23_error) if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 827, __pyx_L22_error) + __PYX_ERR(0, 827, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 827, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L22_error) + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_25 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L22_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_variable = readstat_add_variable(__pyx_v_writer, __pyx_t_24, __pyx_t_25, __pyx_v_max_length); + __pyx_t_27 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_variable = readstat_add_variable(__pyx_v_writer, __pyx_t_26, __pyx_t_27, __pyx_v_max_length); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyreadstat/_readstat_writer.pyx":829 @@ -14683,7 +14789,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * tempformat = variable_format.get(variable_name) * if tempformat: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 829, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 829, __pyx_L23_error) if (__pyx_t_6) { /* "pyreadstat/_readstat_writer.pyx":830 @@ -14695,11 +14801,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_format == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 830, __pyx_L22_error) + __PYX_ERR(0, 830, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_format, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_format, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 830, __pyx_L22_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 830, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_v_tempformat, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; @@ -14714,7 +14820,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_tempformat); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 831, __pyx_L22_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 831, __pyx_L23_error) __pyx_t_6 = (__pyx_temp != 0); } @@ -14729,12 +14835,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_tempformat == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 832, __pyx_L22_error) + __PYX_ERR(0, 832, __pyx_L23_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_tempformat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_tempformat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L22_error) - readstat_variable_set_format(__pyx_v_variable, __pyx_t_26); + __pyx_t_28 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_28) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L23_error) + readstat_variable_set_format(__pyx_v_variable, __pyx_t_28); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyreadstat/_readstat_writer.pyx":831 @@ -14762,35 +14868,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 833, __pyx_L22_error) + __PYX_ERR(0, 833, __pyx_L23_error) } - __pyx_t_18 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 833, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_18) { + if (__pyx_t_20) { } else { - __pyx_t_6 = __pyx_t_18; - goto __pyx_L54_bool_binop_done; + __pyx_t_6 = __pyx_t_20; + goto __pyx_L55_bool_binop_done; } - __pyx_t_18 = (__pyx_v_variable_format == ((PyObject*)Py_None)); - if (!__pyx_t_18) { + __pyx_t_20 = (__pyx_v_variable_format == ((PyObject*)Py_None)); + if (!__pyx_t_20) { } else { - __pyx_t_6 = __pyx_t_18; - goto __pyx_L54_bool_binop_done; + __pyx_t_6 = __pyx_t_20; + goto __pyx_L55_bool_binop_done; } if (unlikely(__pyx_v_variable_format == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 833, __pyx_L22_error) + __PYX_ERR(0, 833, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_variable_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_variable_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 833, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_t_18; - __pyx_L54_bool_binop_done:; + __pyx_t_6 = __pyx_t_20; + __pyx_L55_bool_binop_done:; if (__pyx_t_6) { /* "pyreadstat/_readstat_writer.pyx":834 @@ -14798,17 +14904,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): * curformat = get_datetimelike_format_for_readstat(file_format, curtype) # <<<<<<<<<<<<<< * readstat_variable_set_format(variable, curformat) - * # prepare string_ref + * if variable_informat: */ - __pyx_t_16 = __pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat(__pyx_v_file_format, __pyx_v_curtype); if (unlikely(__pyx_t_16 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L22_error) - __pyx_v_curformat = __pyx_t_16; + __pyx_t_18 = __pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat(__pyx_v_file_format, __pyx_v_curtype); if (unlikely(__pyx_t_18 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L23_error) + __pyx_v_curformat = __pyx_t_18; /* "pyreadstat/_readstat_writer.pyx":835 * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) # <<<<<<<<<<<<<< - * # prepare string_ref - * # for STRING_REF we have to add to a dict here before start writing + * if variable_informat: + * tempformat = variable_informat.get(variable_name) */ readstat_variable_set_format(__pyx_v_variable, __pyx_v_curformat); @@ -14821,7 +14927,86 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":838 + /* "pyreadstat/_readstat_writer.pyx":836 + * curformat = get_datetimelike_format_for_readstat(file_format, curtype) + * readstat_variable_set_format(variable, curformat) + * if variable_informat: # <<<<<<<<<<<<<< + * tempformat = variable_informat.get(variable_name) + * if tempformat: +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_informat); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 836, __pyx_L23_error) + if (__pyx_t_6) { + + /* "pyreadstat/_readstat_writer.pyx":837 + * readstat_variable_set_format(variable, curformat) + * if variable_informat: + * tempformat = variable_informat.get(variable_name) # <<<<<<<<<<<<<< + * if tempformat: + * readstat_variable_set_informat(variable, tempformat.encode("utf-8")) +*/ + if (unlikely(__pyx_v_variable_informat == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); + __PYX_ERR(0, 837, __pyx_L23_error) + } + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_informat, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 837, __pyx_L23_error) + __Pyx_XDECREF_SET(__pyx_v_tempformat, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_writer.pyx":838 + * if variable_informat: + * tempformat = variable_informat.get(variable_name) + * if tempformat: # <<<<<<<<<<<<<< + * readstat_variable_set_informat(variable, tempformat.encode("utf-8")) + * # prepare string_ref +*/ + if (__pyx_v_tempformat == Py_None) __pyx_t_6 = 0; + else + { + Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_tempformat); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 838, __pyx_L23_error) + __pyx_t_6 = (__pyx_temp != 0); + } + + if (__pyx_t_6) { + + /* "pyreadstat/_readstat_writer.pyx":839 + * tempformat = variable_informat.get(variable_name) + * if tempformat: + * readstat_variable_set_informat(variable, tempformat.encode("utf-8")) # <<<<<<<<<<<<<< + * # prepare string_ref + * # for STRING_REF we have to add to a dict here before start writing +*/ + if (unlikely(__pyx_v_tempformat == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); + __PYX_ERR(0, 839, __pyx_L23_error) + } + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_tempformat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_29 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_29) && PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L23_error) + readstat_variable_set_informat(__pyx_v_variable, __pyx_t_29); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_writer.pyx":838 + * if variable_informat: + * tempformat = variable_informat.get(variable_name) + * if tempformat: # <<<<<<<<<<<<<< + * readstat_variable_set_informat(variable, tempformat.encode("utf-8")) + * # prepare string_ref +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":836 + * curformat = get_datetimelike_format_for_readstat(file_format, curtype) + * readstat_variable_set_format(variable, curformat) + * if variable_informat: # <<<<<<<<<<<<<< + * tempformat = variable_informat.get(variable_name) + * if tempformat: +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":842 * # prepare string_ref * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -14831,59 +15016,59 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":839 + /* "pyreadstat/_readstat_writer.pyx":843 * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: # <<<<<<<<<<<<<< * if curval not in strref_map: * curvalstr = str(curval) */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_df, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_df, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L22_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 843, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 843, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 843, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L23_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_3); + __pyx_t_1 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 843, __pyx_L23_error) PyErr_Clear(); } break; @@ -14893,54 +15078,54 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_curval, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":840 + /* "pyreadstat/_readstat_writer.pyx":844 * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: * if curval not in strref_map: # <<<<<<<<<<<<<< * curvalstr = str(curval) * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) */ - __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_curval, __pyx_v_strref_map, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 840, __pyx_L22_error) + __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_curval, __pyx_v_strref_map, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 844, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":841 + /* "pyreadstat/_readstat_writer.pyx":845 * for curval in df[variable_name]: * if curval not in strref_map: * curvalstr = str(curval) # <<<<<<<<<<<<<< * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) * strref_map[curvalstr] = strref_cnt */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":842 + /* "pyreadstat/_readstat_writer.pyx":846 * if curval not in strref_map: * curvalstr = str(curval) * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) # <<<<<<<<<<<<<< * strref_map[curvalstr] = strref_cnt * strref_cnt += 1 */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_27 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_27) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L22_error) - __pyx_v_strref = readstat_add_string_ref(__pyx_v_writer, __pyx_t_27); + __pyx_t_30 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_30) && PyErr_Occurred())) __PYX_ERR(0, 846, __pyx_L23_error) + __pyx_v_strref = readstat_add_string_ref(__pyx_v_writer, __pyx_t_30); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":843 + /* "pyreadstat/_readstat_writer.pyx":847 * curvalstr = str(curval) * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) * strref_map[curvalstr] = strref_cnt # <<<<<<<<<<<<<< * strref_cnt += 1 * # labels */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_strref_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_strref_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_strref_map, __pyx_v_curvalstr, __pyx_t_1) < 0))) __PYX_ERR(0, 843, __pyx_L22_error) + if (unlikely((PyDict_SetItem(__pyx_v_strref_map, __pyx_v_curvalstr, __pyx_t_1) < 0))) __PYX_ERR(0, 847, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":844 + /* "pyreadstat/_readstat_writer.pyx":848 * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) * strref_map[curvalstr] = strref_cnt * strref_cnt += 1 # <<<<<<<<<<<<<< @@ -14949,7 +15134,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_strref_cnt = (__pyx_v_strref_cnt + 1); - /* "pyreadstat/_readstat_writer.pyx":840 + /* "pyreadstat/_readstat_writer.pyx":844 * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: * if curval not in strref_map: # <<<<<<<<<<<<<< @@ -14958,7 +15143,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":839 + /* "pyreadstat/_readstat_writer.pyx":843 * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: # <<<<<<<<<<<<<< @@ -14966,9 +15151,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * curvalstr = str(curval) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":838 + /* "pyreadstat/_readstat_writer.pyx":842 * # prepare string_ref * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -14977,7 +15162,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":846 + /* "pyreadstat/_readstat_writer.pyx":850 * strref_cnt += 1 * # labels * if col_label_count: # <<<<<<<<<<<<<< @@ -14987,69 +15172,69 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_col_label_count != 0); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":847 + /* "pyreadstat/_readstat_writer.pyx":851 * # labels * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = (__pyx_t_3 != Py_None); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_t_4 != Py_None); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":848 + /* "pyreadstat/_readstat_writer.pyx":852 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_3)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 848, __pyx_L22_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_4)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 852, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_6)) { - /* "pyreadstat/_readstat_writer.pyx":849 + /* "pyreadstat/_readstat_writer.pyx":853 * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") # <<<<<<<<<<<<<< * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) */ - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 849, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Column_labels_must_be_strings}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Column_labels_must_be_strings}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 849, __pyx_L22_error) + __PYX_ERR(0, 853, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":848 + /* "pyreadstat/_readstat_writer.pyx":852 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< @@ -15058,31 +15243,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":850 + /* "pyreadstat/_readstat_writer.pyx":854 * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") # <<<<<<<<<<<<<< * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 850, __pyx_L22_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 854, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_v_cur_col_label, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":851 + /* "pyreadstat/_readstat_writer.pyx":855 * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) # <<<<<<<<<<<<<< @@ -15091,12 +15276,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_cur_col_label == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 851, __pyx_L22_error) + __PYX_ERR(0, 855, __pyx_L23_error) } - __pyx_t_28 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_28) && PyErr_Occurred())) __PYX_ERR(0, 851, __pyx_L22_error) - readstat_variable_set_label(__pyx_v_variable, __pyx_t_28); + __pyx_t_31 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_31) && PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L23_error) + readstat_variable_set_label(__pyx_v_variable, __pyx_t_31); - /* "pyreadstat/_readstat_writer.pyx":847 + /* "pyreadstat/_readstat_writer.pyx":851 * # labels * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< @@ -15105,7 +15290,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":846 + /* "pyreadstat/_readstat_writer.pyx":850 * strref_cnt += 1 * # labels * if col_label_count: # <<<<<<<<<<<<<< @@ -15114,17 +15299,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":852 + /* "pyreadstat/_readstat_writer.pyx":856 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< * value_labels = variable_value_labels.get(variable_name) * if value_labels: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 852, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 856, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":853 + /* "pyreadstat/_readstat_writer.pyx":857 * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) # <<<<<<<<<<<<<< @@ -15133,43 +15318,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 853, __pyx_L22_error) + __PYX_ERR(0, 857, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 853, __pyx_L22_error) + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 857, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_v_value_labels, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":854 + /* "pyreadstat/_readstat_writer.pyx":858 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 854, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 858, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":855 + /* "pyreadstat/_readstat_writer.pyx":859 * value_labels = variable_value_labels.get(variable_name) * if value_labels: * labelset_name = variable_name + str(lblset_cnt) # <<<<<<<<<<<<<< * lblset_cnt += 1 * curuser_missing = None */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L22_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_labelset_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":856 + /* "pyreadstat/_readstat_writer.pyx":860 * if value_labels: * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 # <<<<<<<<<<<<<< @@ -15178,7 +15363,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = (__pyx_v_lblset_cnt + 1); - /* "pyreadstat/_readstat_writer.pyx":857 + /* "pyreadstat/_readstat_writer.pyx":861 * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 * curuser_missing = None # <<<<<<<<<<<<<< @@ -15188,17 +15373,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":858 + /* "pyreadstat/_readstat_writer.pyx":862 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 858, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 862, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":859 + /* "pyreadstat/_readstat_writer.pyx":863 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) # <<<<<<<<<<<<<< @@ -15207,14 +15392,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 859, __pyx_L22_error) + __PYX_ERR(0, 863, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":858 + /* "pyreadstat/_readstat_writer.pyx":862 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -15223,7 +15408,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":860 + /* "pyreadstat/_readstat_writer.pyx":864 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< @@ -15232,40 +15417,40 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_t_1 = __pyx_v_labelset_name; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 860, __pyx_L22_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 864, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":861 + /* "pyreadstat/_readstat_writer.pyx":865 * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) # <<<<<<<<<<<<<< * readstat_variable_set_label_set(variable, label_set) * # missing ranges */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_22 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_v_variable_name; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_24 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_4); + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_3 = __pyx_v_curuser_missing; __Pyx_INCREF(__pyx_t_3); - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 861, __pyx_L22_error) - __pyx_t_9 = __pyx_v_curuser_missing; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_9))) __PYX_ERR(0, 861, __pyx_L22_error) + if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_3))) __PYX_ERR(0, 865, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":860 + /* "pyreadstat/_readstat_writer.pyx":864 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) */ - __pyx_t_29 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_t_1), __pyx_t_22, __pyx_v_file_format, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_9)); if (unlikely(__pyx_t_29 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L22_error) + __pyx_t_32 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_t_1), __pyx_t_24, __pyx_v_file_format, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_3)); if (unlikely(__pyx_t_32 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_label_set = __pyx_t_29; + __pyx_v_label_set = __pyx_t_32; - /* "pyreadstat/_readstat_writer.pyx":862 + /* "pyreadstat/_readstat_writer.pyx":866 * label_set = set_value_label(writer, value_labels, labelset_name, * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) # <<<<<<<<<<<<<< @@ -15274,7 +15459,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_variable_set_label_set(__pyx_v_variable, __pyx_v_label_set); - /* "pyreadstat/_readstat_writer.pyx":854 + /* "pyreadstat/_readstat_writer.pyx":858 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< @@ -15283,7 +15468,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":852 + /* "pyreadstat/_readstat_writer.pyx":856 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< @@ -15292,17 +15477,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":864 + /* "pyreadstat/_readstat_writer.pyx":868 * readstat_variable_set_label_set(variable, label_set) * # missing ranges * if missing_ranges: # <<<<<<<<<<<<<< * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 864, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 868, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":865 + /* "pyreadstat/_readstat_writer.pyx":869 * # missing ranges * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) # <<<<<<<<<<<<<< @@ -15311,24 +15496,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_ranges == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 865, __pyx_L22_error) + __PYX_ERR(0, 869, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_cur_ranges, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur_ranges, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":866 + /* "pyreadstat/_readstat_writer.pyx":870 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 866, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 870, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":867 + /* "pyreadstat/_readstat_writer.pyx":871 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -15336,10 +15521,10 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * raise PyreadstatError(msg) */ __pyx_t_6 = PyList_Check(__pyx_v_cur_ranges); - __pyx_t_18 = (!__pyx_t_6); - if (unlikely(__pyx_t_18)) { + __pyx_t_20 = (!__pyx_t_6); + if (unlikely(__pyx_t_20)) { - /* "pyreadstat/_readstat_writer.pyx":868 + /* "pyreadstat/_readstat_writer.pyx":872 * if cur_ranges: * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" # <<<<<<<<<<<<<< @@ -15349,41 +15534,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_values_in_diction); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_values_in_diction; - /* "pyreadstat/_readstat_writer.pyx":869 + /* "pyreadstat/_readstat_writer.pyx":873 * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: */ - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L22_error) + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_3); + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_msg}; - __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_msg}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 869, __pyx_L22_error) + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 873, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":867 + /* "pyreadstat/_readstat_writer.pyx":871 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -15392,24 +15577,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":870 + /* "pyreadstat/_readstat_writer.pyx":874 * msg = "missing_ranges: values in dictionary must be list" * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) # <<<<<<<<<<<<<< * if variable_alignment: * # At the moment this is ineffective for sav and dta (the function runs but in */ - __pyx_t_9 = __pyx_v_cur_ranges; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_9))) __PYX_ERR(0, 870, __pyx_L22_error) + __pyx_t_3 = __pyx_v_cur_ranges; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_3))) __PYX_ERR(0, 874, __pyx_L23_error) __pyx_t_1 = __pyx_v_variable_name; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 870, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_t_9), __pyx_v_variable, __pyx_v_curtype, ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 870, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 874, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_t_3), __pyx_v_variable, __pyx_v_curtype, ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":866 + /* "pyreadstat/_readstat_writer.pyx":870 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< @@ -15418,7 +15603,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":864 + /* "pyreadstat/_readstat_writer.pyx":868 * readstat_variable_set_label_set(variable, label_set) * # missing ranges * if missing_ranges: # <<<<<<<<<<<<<< @@ -15427,17 +15612,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":871 + /* "pyreadstat/_readstat_writer.pyx":875 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: # <<<<<<<<<<<<<< * # At the moment this is ineffective for sav and dta (the function runs but in * # the resulting file all alignments are still unknown) */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 871, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 875, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":874 + /* "pyreadstat/_readstat_writer.pyx":878 * # At the moment this is ineffective for sav and dta (the function runs but in * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) # <<<<<<<<<<<<<< @@ -15446,24 +15631,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_alignment == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 874, __pyx_L22_error) + __PYX_ERR(0, 878, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cur_alignment, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":875 + /* "pyreadstat/_readstat_writer.pyx":879 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 875, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 879, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":876 + /* "pyreadstat/_readstat_writer.pyx":880 * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) # <<<<<<<<<<<<<< @@ -15472,15 +15657,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_t_1 = __pyx_v_cur_alignment; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 876, __pyx_L22_error) - __pyx_t_9 = __pyx_v_variable_name; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 876, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_9)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 876, __pyx_L22_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 880, __pyx_L23_error) + __pyx_t_3 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 880, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":875 + /* "pyreadstat/_readstat_writer.pyx":879 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< @@ -15489,7 +15674,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":871 + /* "pyreadstat/_readstat_writer.pyx":875 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: # <<<<<<<<<<<<<< @@ -15498,17 +15683,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":877 + /* "pyreadstat/_readstat_writer.pyx":881 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 877, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 881, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":878 + /* "pyreadstat/_readstat_writer.pyx":882 * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) # <<<<<<<<<<<<<< @@ -15517,38 +15702,38 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_display_width == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 878, __pyx_L22_error) + __PYX_ERR(0, 882, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 878, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_cur_display_width, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur_display_width, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":879 + /* "pyreadstat/_readstat_writer.pyx":883 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 879, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 883, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":880 + /* "pyreadstat/_readstat_writer.pyx":884 * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) # <<<<<<<<<<<<<< * if variable_measure: * cur_measure = variable_measure.get(variable_name) */ - __pyx_t_23 = __Pyx_PyLong_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L22_error) - __pyx_t_9 = __pyx_v_variable_name; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 880, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_23, ((PyObject*)__pyx_t_9)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L23_error) + __pyx_t_3 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 884, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_25, ((PyObject*)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":879 + /* "pyreadstat/_readstat_writer.pyx":883 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< @@ -15557,7 +15742,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":877 + /* "pyreadstat/_readstat_writer.pyx":881 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< @@ -15566,17 +15751,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":881 + /* "pyreadstat/_readstat_writer.pyx":885 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< * cur_measure = variable_measure.get(variable_name) * if cur_measure: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 881, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 885, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":882 + /* "pyreadstat/_readstat_writer.pyx":886 * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: * cur_measure = variable_measure.get(variable_name) # <<<<<<<<<<<<<< @@ -15585,41 +15770,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_measure == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 882, __pyx_L22_error) + __PYX_ERR(0, 886, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_cur_measure, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur_measure, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":883 + /* "pyreadstat/_readstat_writer.pyx":887 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< * set_variable_measure(variable, cur_measure, variable_name) * */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 883, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 887, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":884 + /* "pyreadstat/_readstat_writer.pyx":888 * cur_measure = variable_measure.get(variable_name) * if cur_measure: * set_variable_measure(variable, cur_measure, variable_name) # <<<<<<<<<<<<<< * * # start writing */ - __pyx_t_9 = __pyx_v_cur_measure; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 884, __pyx_L22_error) + __pyx_t_3 = __pyx_v_cur_measure; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 888, __pyx_L23_error) __pyx_t_1 = __pyx_v_variable_name; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 884, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_t_9), ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 888, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":883 + /* "pyreadstat/_readstat_writer.pyx":887 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< @@ -15628,7 +15813,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":881 + /* "pyreadstat/_readstat_writer.pyx":885 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< @@ -15638,7 +15823,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } } - /* "pyreadstat/_readstat_writer.pyx":887 + /* "pyreadstat/_readstat_writer.pyx":891 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -15648,16 +15833,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT: - /* "pyreadstat/_readstat_writer.pyx":888 + /* "pyreadstat/_readstat_writer.pyx":892 * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bcat(__pyx_v_writer, (&__pyx_v_fd))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bcat(__pyx_v_writer, (&__pyx_v_fd))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":887 + /* "pyreadstat/_readstat_writer.pyx":891 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -15667,16 +15852,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA: - /* "pyreadstat/_readstat_writer.pyx":890 + /* "pyreadstat/_readstat_writer.pyx":894 * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_dta(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_dta(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 894, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":889 + /* "pyreadstat/_readstat_writer.pyx":893 * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -15686,16 +15871,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: - /* "pyreadstat/_readstat_writer.pyx":892 + /* "pyreadstat/_readstat_writer.pyx":896 * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sav(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sav(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":891 + /* "pyreadstat/_readstat_writer.pyx":895 * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: # <<<<<<<<<<<<<< @@ -15705,16 +15890,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":894 + /* "pyreadstat/_readstat_writer.pyx":898 * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_por(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 894, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_por(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":893 + /* "pyreadstat/_readstat_writer.pyx":897 * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -15724,16 +15909,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT: - /* "pyreadstat/_readstat_writer.pyx":896 + /* "pyreadstat/_readstat_writer.pyx":900 * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_XPORT: * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bdat(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bdat(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":895 + /* "pyreadstat/_readstat_writer.pyx":899 * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -15743,16 +15928,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT: - /* "pyreadstat/_readstat_writer.pyx":898 + /* "pyreadstat/_readstat_writer.pyx":902 * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) # <<<<<<<<<<<<<< * else: * raise PyreadstatError("unknown file format") */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_xport(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 898, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_xport(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":897 + /* "pyreadstat/_readstat_writer.pyx":901 * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: # <<<<<<<<<<<<<< @@ -15762,52 +15947,52 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; default: - /* "pyreadstat/_readstat_writer.pyx":900 + /* "pyreadstat/_readstat_writer.pyx":904 * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) * else: * raise PyreadstatError("unknown file format") # <<<<<<<<<<<<<< * * # validation */ - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_unknown_file_format}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_unknown_file_format}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 900, __pyx_L22_error) + __PYX_ERR(0, 904, __pyx_L23_error) break; } - /* "pyreadstat/_readstat_writer.pyx":903 + /* "pyreadstat/_readstat_writer.pyx":907 * * # validation * check_exit_status(readstat_validate_metadata(writer)) # <<<<<<<<<<<<<< * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 903, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 907, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":904 + /* "pyreadstat/_readstat_writer.pyx":908 * # validation * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -15815,11 +16000,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_validate_variable(writer, tempvar)) */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":905 + /* "pyreadstat/_readstat_writer.pyx":909 * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -15828,138 +16013,138 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_tempvar = readstat_get_variable(__pyx_v_writer, __pyx_v_col_indx); - /* "pyreadstat/_readstat_writer.pyx":906 + /* "pyreadstat/_readstat_writer.pyx":910 * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) * check_exit_status(readstat_validate_variable(writer, tempvar)) # <<<<<<<<<<<<<< * * # vectorized transform of datetime64ns columns */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_variable(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_variable(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 910, __pyx_L23_error) } - /* "pyreadstat/_readstat_writer.pyx":909 + /* "pyreadstat/_readstat_writer.pyx":913 * * # vectorized transform of datetime64ns columns * pywriter_types = [x[0] for x in col_types] # <<<<<<<<<<<<<< * pywriter_timeunits = [x[3] for x in col_types] * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L22_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 909, __pyx_L22_error) + __PYX_ERR(0, 913, __pyx_L23_error) } - __pyx_t_3 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 909, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 913, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 909, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 909, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 909, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 913, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pywriter_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":910 + /* "pyreadstat/_readstat_writer.pyx":914 * # vectorized transform of datetime64ns columns * pywriter_types = [x[0] for x in col_types] * pywriter_timeunits = [x[3] for x in col_types] # <<<<<<<<<<<<<< * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types * hasdate64 = PYWRITER_DATE64 in pywriter_types */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L22_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 910, __pyx_L22_error) + __PYX_ERR(0, 914, __pyx_L23_error) } - __pyx_t_3 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 910, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 914, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 910, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 914, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pywriter_timeunits = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":911 + /* "pyreadstat/_readstat_writer.pyx":915 * pywriter_types = [x[0] for x in col_types] * pywriter_timeunits = [x[3] for x in col_types] * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types # <<<<<<<<<<<<<< * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 911, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 915, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_hasdatetime64 = __pyx_t_18; + __pyx_v_hasdatetime64 = __pyx_t_20; - /* "pyreadstat/_readstat_writer.pyx":912 + /* "pyreadstat/_readstat_writer.pyx":916 * pywriter_timeunits = [x[3] for x in col_types] * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types * hasdate64 = PYWRITER_DATE64 in pywriter_types # <<<<<<<<<<<<<< * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 912, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 916, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hasdate64 = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":913 + /* "pyreadstat/_readstat_writer.pyx":917 * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types # <<<<<<<<<<<<<< * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 913, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 917, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hastime64 = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":914 + /* "pyreadstat/_readstat_writer.pyx":918 * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: # <<<<<<<<<<<<<< @@ -15968,41 +16153,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (!__pyx_v_hasdatetime64) { } else { - __pyx_t_18 = __pyx_v_hasdatetime64; - goto __pyx_L86_bool_binop_done; + __pyx_t_20 = __pyx_v_hasdatetime64; + goto __pyx_L89_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 914, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 918, __pyx_L23_error) if (!__pyx_t_6) { } else { - __pyx_t_18 = __pyx_t_6; - goto __pyx_L86_bool_binop_done; + __pyx_t_20 = __pyx_t_6; + goto __pyx_L89_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 914, __pyx_L22_error) - __pyx_t_18 = __pyx_t_6; - __pyx_L86_bool_binop_done:; - if (__pyx_t_18) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 918, __pyx_L23_error) + __pyx_t_20 = __pyx_t_6; + __pyx_L89_bool_binop_done:; + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":915 + /* "pyreadstat/_readstat_writer.pyx":919 * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() # <<<<<<<<<<<<<< * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) */ - __pyx_t_3 = __pyx_v_df; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_df; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clone, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_df2 = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":916 + /* "pyreadstat/_readstat_writer.pyx":920 * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() * if hasdatetime64: # <<<<<<<<<<<<<< @@ -16011,19 +16196,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_hasdatetime64) { - /* "pyreadstat/_readstat_writer.pyx":917 + /* "pyreadstat/_readstat_writer.pyx":921 * df2 = df.clone() * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) # <<<<<<<<<<<<<< * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_pywriter_timeunits, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L22_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_pywriter_timeunits, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_df2, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":916 + /* "pyreadstat/_readstat_writer.pyx":920 * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() * if hasdatetime64: # <<<<<<<<<<<<<< @@ -16032,29 +16217,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":918 + /* "pyreadstat/_readstat_writer.pyx":922 * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) * if hasdate64: # <<<<<<<<<<<<<< * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 918, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 922, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":919 + /* "pyreadstat/_readstat_writer.pyx":923 * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) # <<<<<<<<<<<<<< * if hastime64: * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L22_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_df2, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":918 + /* "pyreadstat/_readstat_writer.pyx":922 * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) * if hasdate64: # <<<<<<<<<<<<<< @@ -16063,29 +16248,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":920 + /* "pyreadstat/_readstat_writer.pyx":924 * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: # <<<<<<<<<<<<<< * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) * else: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 920, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 924, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":921 + /* "pyreadstat/_readstat_writer.pyx":925 * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) # <<<<<<<<<<<<<< * else: * df2 = df */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L22_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_df2, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":920 + /* "pyreadstat/_readstat_writer.pyx":924 * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: # <<<<<<<<<<<<<< @@ -16094,17 +16279,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":914 + /* "pyreadstat/_readstat_writer.pyx":918 * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: # <<<<<<<<<<<<<< * df2 = df.clone() * if hasdatetime64: */ - goto __pyx_L85; + goto __pyx_L88; } - /* "pyreadstat/_readstat_writer.pyx":923 + /* "pyreadstat/_readstat_writer.pyx":927 * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) * else: * df2 = df # <<<<<<<<<<<<<< @@ -16115,9 +16300,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_df); __pyx_v_df2 = __pyx_v_df; } - __pyx_L85:; + __pyx_L88:; - /* "pyreadstat/_readstat_writer.pyx":927 + /* "pyreadstat/_readstat_writer.pyx":931 * * # inserting * rowcnt = 0 # <<<<<<<<<<<<<< @@ -16127,67 +16312,67 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_rowcnt = __pyx_mstate_global->__pyx_int_0; - /* "pyreadstat/_readstat_writer.pyx":929 + /* "pyreadstat/_readstat_writer.pyx":933 * rowcnt = 0 * * for row in df2.iter_rows(): # <<<<<<<<<<<<<< * check_exit_status(readstat_begin_row(writer)) * */ - __pyx_t_3 = __pyx_v_df2; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_df2; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_iter_rows, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 929, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 929, __pyx_L22_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 933, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 933, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 933, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L23_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_3); + __pyx_t_1 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 933, __pyx_L23_error) PyErr_Clear(); } break; @@ -16197,16 +16382,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":930 + /* "pyreadstat/_readstat_writer.pyx":934 * * for row in df2.iter_rows(): * check_exit_status(readstat_begin_row(writer)) # <<<<<<<<<<<<<< * * for col_indx in range(col_count): */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 934, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":932 + /* "pyreadstat/_readstat_writer.pyx":936 * check_exit_status(readstat_begin_row(writer)) * * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -16214,11 +16399,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * tempvar = readstat_get_variable(writer, col_indx) */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":934 + /* "pyreadstat/_readstat_writer.pyx":938 * for col_indx in range(col_count): * * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -16227,32 +16412,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_tempvar = readstat_get_variable(__pyx_v_writer, __pyx_v_col_indx); - /* "pyreadstat/_readstat_writer.pyx":935 + /* "pyreadstat/_readstat_writer.pyx":939 * * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] # <<<<<<<<<<<<<< * curtype = pywriter_types[col_indx] * is_missing = col_types[col_indx][2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curval, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":936 + /* "pyreadstat/_readstat_writer.pyx":940 * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] * curtype = pywriter_types[col_indx] # <<<<<<<<<<<<<< * is_missing = col_types[col_indx][2] * curuser_missing = None */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_22 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 936, __pyx_L22_error) + __pyx_t_24 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_curtype = __pyx_t_22; + __pyx_v_curtype = __pyx_t_24; - /* "pyreadstat/_readstat_writer.pyx":937 + /* "pyreadstat/_readstat_writer.pyx":941 * curval = row[col_indx] * curtype = pywriter_types[col_indx] * is_missing = col_types[col_indx][2] # <<<<<<<<<<<<<< @@ -16261,17 +16446,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 937, __pyx_L22_error) + __PYX_ERR(0, 941, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 937, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_is_missing, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_is_missing, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":938 + /* "pyreadstat/_readstat_writer.pyx":942 * curtype = pywriter_types[col_indx] * is_missing = col_types[col_indx][2] * curuser_missing = None # <<<<<<<<<<<<<< @@ -16281,17 +16466,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":939 + /* "pyreadstat/_readstat_writer.pyx":943 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(col_names[col_indx]) * */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 939, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 943, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":940 + /* "pyreadstat/_readstat_writer.pyx":944 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(col_names[col_indx]) # <<<<<<<<<<<<<< @@ -16300,21 +16485,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 940, __pyx_L22_error) + __PYX_ERR(0, 944, __pyx_L23_error) } if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 940, __pyx_L22_error) + __PYX_ERR(0, 944, __pyx_L23_error) } - __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 940, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_9, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L22_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":939 + /* "pyreadstat/_readstat_writer.pyx":943 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -16323,17 +16508,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":942 + /* "pyreadstat/_readstat_writer.pyx":946 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 942, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 946, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":944 + /* "pyreadstat/_readstat_writer.pyx":948 * if is_missing: * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: # <<<<<<<<<<<<<< @@ -16342,37 +16527,37 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_is_pandas) { - /* "pyreadstat/_readstat_writer.pyx":945 + /* "pyreadstat/_readstat_writer.pyx":949 * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: * check_if_missing = pd.isna(curval) # <<<<<<<<<<<<<< * # for other libraries the value would be None * else: */ - __pyx_t_9 = __pyx_v_pd; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = __pyx_v_pd; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_curval}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_curval}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isna, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_check_if_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":944 + /* "pyreadstat/_readstat_writer.pyx":948 * if is_missing: * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: # <<<<<<<<<<<<<< * check_if_missing = pd.isna(curval) * # for other libraries the value would be None */ - goto __pyx_L98; + goto __pyx_L101; } - /* "pyreadstat/_readstat_writer.pyx":948 + /* "pyreadstat/_readstat_writer.pyx":952 * # for other libraries the value would be None * else: * check_if_missing = curval is None # <<<<<<<<<<<<<< @@ -16380,43 +16565,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_insert_missing_value(writer, tempvar)) */ /*else*/ { - __pyx_t_18 = (__pyx_v_curval == Py_None); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L22_error) + __pyx_t_20 = (__pyx_v_curval == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_check_if_missing, __pyx_t_1); __pyx_t_1 = 0; } - __pyx_L98:; + __pyx_L101:; - /* "pyreadstat/_readstat_writer.pyx":949 + /* "pyreadstat/_readstat_writer.pyx":953 * else: * check_if_missing = curval is None * if check_if_missing: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_check_if_missing); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 949, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_check_if_missing); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 953, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":950 + /* "pyreadstat/_readstat_writer.pyx":954 * check_if_missing = curval is None * if check_if_missing: * check_exit_status(readstat_insert_missing_value(writer, tempvar)) # <<<<<<<<<<<<<< * continue * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_missing_value(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 950, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_missing_value(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":951 + /* "pyreadstat/_readstat_writer.pyx":955 * if check_if_missing: * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue # <<<<<<<<<<<<<< * * if curuser_missing and curtype in pywriter_numeric_types: */ - goto __pyx_L94_continue; + goto __pyx_L97_continue; - /* "pyreadstat/_readstat_writer.pyx":949 + /* "pyreadstat/_readstat_writer.pyx":953 * else: * check_if_missing = curval is None * if check_if_missing: # <<<<<<<<<<<<<< @@ -16425,7 +16610,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":942 + /* "pyreadstat/_readstat_writer.pyx":946 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< @@ -16434,61 +16619,61 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":953 + /* "pyreadstat/_readstat_writer.pyx":957 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 953, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 957, __pyx_L23_error) if (__pyx_t_6) { } else { - __pyx_t_18 = __pyx_t_6; - goto __pyx_L101_bool_binop_done; + __pyx_t_20 = __pyx_t_6; + goto __pyx_L104_bool_binop_done; } - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 953, __pyx_L22_error) + __PYX_ERR(0, 957, __pyx_L23_error) } - __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 953, __pyx_L22_error) + __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 957, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_18 = __pyx_t_6; - __pyx_L101_bool_binop_done:; - if (__pyx_t_18) { + __pyx_t_20 = __pyx_t_6; + __pyx_L104_bool_binop_done:; + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":954 + /* "pyreadstat/_readstat_writer.pyx":958 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue */ - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 954, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 958, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":955 + /* "pyreadstat/_readstat_writer.pyx":959 * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_30 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_30 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 955, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_30)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L22_error) + __pyx_t_33 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_33 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 959, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_33)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":956 + /* "pyreadstat/_readstat_writer.pyx":960 * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue # <<<<<<<<<<<<<< * * if curtype == PYWRITER_DOUBLE: */ - goto __pyx_L94_continue; + goto __pyx_L97_continue; - /* "pyreadstat/_readstat_writer.pyx":954 + /* "pyreadstat/_readstat_writer.pyx":958 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< @@ -16497,7 +16682,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":953 + /* "pyreadstat/_readstat_writer.pyx":957 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -16506,246 +16691,246 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":958 + /* "pyreadstat/_readstat_writer.pyx":962 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":959 + /* "pyreadstat/_readstat_writer.pyx":963 * * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) */ - __pyx_t_31 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_31 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_31))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L22_error) + __pyx_t_34 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_34 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_34))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":958 + /* "pyreadstat/_readstat_writer.pyx":962 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":960 + /* "pyreadstat/_readstat_writer.pyx":964 * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":961 + /* "pyreadstat/_readstat_writer.pyx":965 * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) */ - __pyx_t_32 = __Pyx_PyLong_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_32 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L22_error) + __pyx_t_35 = __Pyx_PyLong_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_35 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_35)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":960 + /* "pyreadstat/_readstat_writer.pyx":964 * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":962 + /* "pyreadstat/_readstat_writer.pyx":966 * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":963 + /* "pyreadstat/_readstat_writer.pyx":967 * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) */ - __pyx_t_23 = __Pyx_PyLong_As_int(__pyx_v_curval); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_23))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L22_error) + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_v_curval); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_25))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":962 + /* "pyreadstat/_readstat_writer.pyx":966 * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":964 + /* "pyreadstat/_readstat_writer.pyx":968 * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":965 + /* "pyreadstat/_readstat_writer.pyx":969 * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) */ - __pyx_t_9 = __pyx_v_curval; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = __pyx_v_curval; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_33 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_33) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_33)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L22_error) + __pyx_t_36 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_36) && PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_36)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":964 + /* "pyreadstat/_readstat_writer.pyx":968 * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":966 + /* "pyreadstat/_readstat_writer.pyx":970 * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":967 + /* "pyreadstat/_readstat_writer.pyx":971 * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":968 + /* "pyreadstat/_readstat_writer.pyx":972 * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_DTA_STR_REF: * curvalstr = str(curval) */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_33 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_33) && PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_33)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L22_error) + __pyx_t_36 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_36) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_36)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":966 + /* "pyreadstat/_readstat_writer.pyx":970 * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":969 + /* "pyreadstat/_readstat_writer.pyx":973 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":970 + /* "pyreadstat/_readstat_writer.pyx":974 * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: * curvalstr = str(curval) # <<<<<<<<<<<<<< * strref_indx = strref_map[curvalstr] * strref = readstat_get_string_ref(writer, strref_indx) */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":971 + /* "pyreadstat/_readstat_writer.pyx":975 * elif curtype == PYWRITER_DTA_STR_REF: * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] # <<<<<<<<<<<<<< * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_strref_map, __pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_strref_map, __pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_strref_indx, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":972 + /* "pyreadstat/_readstat_writer.pyx":976 * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] * strref = readstat_get_string_ref(writer, strref_indx) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: */ - __pyx_t_23 = __Pyx_PyLong_As_int(__pyx_v_strref_indx); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L22_error) - __pyx_v_strref = readstat_get_string_ref(__pyx_v_writer, __pyx_t_23); + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_v_strref_indx); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L23_error) + __pyx_v_strref = readstat_get_string_ref(__pyx_v_writer, __pyx_t_25); - /* "pyreadstat/_readstat_writer.pyx":973 + /* "pyreadstat/_readstat_writer.pyx":977 * strref_indx = strref_map[curvalstr] * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_ref(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_strref)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_ref(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_strref)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":969 + /* "pyreadstat/_readstat_writer.pyx":973 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":974 + /* "pyreadstat/_readstat_writer.pyx":978 * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -16756,81 +16941,81 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64: - __pyx_t_18 = 1; + __pyx_t_20 = 1; break; default: - __pyx_t_18 = 0; + __pyx_t_20 = 0; break; } - if (__pyx_t_18) { + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":975 + /* "pyreadstat/_readstat_writer.pyx":979 * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) */ - __pyx_t_31 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_31 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_31))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L22_error) + __pyx_t_34 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_34 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 979, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_34))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 979, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":974 + /* "pyreadstat/_readstat_writer.pyx":978 * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype in pyrwriter_datetimelike_types: */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":976 + /* "pyreadstat/_readstat_writer.pyx":980 * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 976, __pyx_L22_error) + __PYX_ERR(0, 980, __pyx_L23_error) } - __pyx_t_18 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 976, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 980, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(__pyx_t_18)) { + if (likely(__pyx_t_20)) { - /* "pyreadstat/_readstat_writer.pyx":977 + /* "pyreadstat/_readstat_writer.pyx":981 * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: */ - __pyx_t_31 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_31 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L22_error) - __pyx_v_dtimelikeval = __pyx_t_31; + __pyx_t_34 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_34 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L23_error) + __pyx_v_dtimelikeval = __pyx_t_34; - /* "pyreadstat/_readstat_writer.pyx":978 + /* "pyreadstat/_readstat_writer.pyx":982 * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unknown data format to insert") */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_dtimelikeval)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_dtimelikeval)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":976 + /* "pyreadstat/_readstat_writer.pyx":980 * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) */ - goto __pyx_L104; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":980 + /* "pyreadstat/_readstat_writer.pyx":984 * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: * raise PyreadstatError("Unknown data format to insert") # <<<<<<<<<<<<<< @@ -16838,59 +17023,59 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_end_row(writer)) */ /*else*/ { - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 984, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Unknown_data_format_to_insert}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Unknown_data_format_to_insert}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 980, __pyx_L22_error) + __PYX_ERR(0, 984, __pyx_L23_error) } - __pyx_L104:; - __pyx_L94_continue:; + __pyx_L107:; + __pyx_L97_continue:; } - /* "pyreadstat/_readstat_writer.pyx":982 + /* "pyreadstat/_readstat_writer.pyx":986 * raise PyreadstatError("Unknown data format to insert") * * check_exit_status(readstat_end_row(writer)) # <<<<<<<<<<<<<< * rowcnt += 1 * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 986, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":983 + /* "pyreadstat/_readstat_writer.pyx":987 * * check_exit_status(readstat_end_row(writer)) * rowcnt += 1 # <<<<<<<<<<<<<< * * check_exit_status(readstat_end_writing(writer)) */ - __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_rowcnt, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_rowcnt, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_rowcnt, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":929 + /* "pyreadstat/_readstat_writer.pyx":933 * rowcnt = 0 * * for row in df2.iter_rows(): # <<<<<<<<<<<<<< @@ -16898,16 +17083,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":985 + /* "pyreadstat/_readstat_writer.pyx":989 * rowcnt += 1 * * check_exit_status(readstat_end_writing(writer)) # <<<<<<<<<<<<<< * * except: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 985, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L23_error) /* "pyreadstat/_readstat_writer.pyx":774 * writer = readstat_writer_init() @@ -16917,19 +17102,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_set_data_writer(writer, write_bytes)) */ } - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L27_try_end; - __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L28_try_end; + __pyx_L23_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":987 + /* "pyreadstat/_readstat_writer.pyx":991 * check_exit_status(readstat_end_writing(writer)) * * except: # <<<<<<<<<<<<<< @@ -16938,24 +17124,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_writer.run_write", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 987, __pyx_L24_except_error) - __Pyx_XGOTREF(__pyx_t_3); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 991, __pyx_L25_except_error) + __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_13); - /* "pyreadstat/_readstat_writer.pyx":988 + /* "pyreadstat/_readstat_writer.pyx":992 * * except: * raise # <<<<<<<<<<<<<< * finally: * readstat_writer_free(writer) */ - __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_2); - __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; - __PYX_ERR(0, 988, __pyx_L24_except_error) + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_13); + __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_13 = 0; + __PYX_ERR(0, 992, __pyx_L25_except_error) } /* "pyreadstat/_readstat_writer.pyx":774 @@ -16965,17 +17151,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * * check_exit_status(readstat_set_data_writer(writer, write_bytes)) */ - __pyx_L24_except_error:; - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); + __pyx_L25_except_error:; __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); - goto __pyx_L20_error; - __pyx_L27_try_end:; + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + goto __pyx_L21_error; + __pyx_L28_try_end:; } } - /* "pyreadstat/_readstat_writer.pyx":990 + /* "pyreadstat/_readstat_writer.pyx":994 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -16986,39 +17172,40 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d /*normal exit:*/{ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":991 + /* "pyreadstat/_readstat_writer.pyx":995 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< * * return 0 */ - __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) - goto __pyx_L21; + __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 995, __pyx_L1_error) + goto __pyx_L22; } - __pyx_L20_error:; + __pyx_L21_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; + __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; __pyx_t_40 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_ExceptionSwap(&__pyx_t_35, &__pyx_t_36, &__pyx_t_37); - if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_ExceptionSwap(&__pyx_t_38, &__pyx_t_39, &__pyx_t_40); + if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_35); - __Pyx_XGOTREF(__pyx_t_36); - __Pyx_XGOTREF(__pyx_t_37); - __pyx_t_12 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_34 = __pyx_filename; + __Pyx_XGOTREF(__pyx_t_38); + __Pyx_XGOTREF(__pyx_t_39); + __Pyx_XGOTREF(__pyx_t_40); + __pyx_t_12 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_37 = __pyx_filename; { - /* "pyreadstat/_readstat_writer.pyx":990 + /* "pyreadstat/_readstat_writer.pyx":994 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -17027,41 +17214,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":991 + /* "pyreadstat/_readstat_writer.pyx":995 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< * * return 0 */ - __pyx_t_20 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_20 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L109_error) + __pyx_t_22 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_22 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 995, __pyx_L112_error) } - __Pyx_XGIVEREF(__pyx_t_35); - __Pyx_XGIVEREF(__pyx_t_36); - __Pyx_XGIVEREF(__pyx_t_37); - __Pyx_ExceptionReset(__pyx_t_35, __pyx_t_36, __pyx_t_37); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_ErrRestore(__pyx_t_15, __pyx_t_14, __pyx_t_13); - __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; - __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_34; + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_16, __pyx_t_15); + __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; __pyx_t_40 = 0; + __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_37; goto __pyx_L1_error; - __pyx_L109_error:; - __Pyx_XGIVEREF(__pyx_t_35); - __Pyx_XGIVEREF(__pyx_t_36); - __Pyx_XGIVEREF(__pyx_t_37); - __Pyx_ExceptionReset(__pyx_t_35, __pyx_t_36, __pyx_t_37); + __pyx_L112_error:; + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_40); + __Pyx_ExceptionReset(__pyx_t_38, __pyx_t_39, __pyx_t_40); + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; + __pyx_t_38 = 0; __pyx_t_39 = 0; __pyx_t_40 = 0; goto __pyx_L1_error; } - __pyx_L21:; + __pyx_L22:; } - /* "pyreadstat/_readstat_writer.pyx":993 + /* "pyreadstat/_readstat_writer.pyx":997 * close_file(fd) * * return 0 # <<<<<<<<<<<<<< @@ -17071,7 +17258,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":685 + /* "pyreadstat/_readstat_writer.pyx":679 * * * cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, # <<<<<<<<<<<<<< @@ -17087,6 +17274,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pyreadstat._readstat_writer.run_write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -17135,7 +17323,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":995 +/* "pyreadstat/_readstat_writer.pyx":999 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -17176,11 +17364,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_missing_user_values = 0; PyObject *__pyx_v_variable_format = 0; PyObject *__pyx_v_variable_alignment = 0; + PyObject *__pyx_v_variable_informat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -17196,88 +17385,92 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_df,&__pyx_mstate_global->__pyx_n_u_dst_path,&__pyx_mstate_global->__pyx_n_u_writer_format,&__pyx_mstate_global->__pyx_n_u_file_label,&__pyx_mstate_global->__pyx_n_u_version,&__pyx_mstate_global->__pyx_n_u_table_name,&__pyx_mstate_global->__pyx_n_u_column_labels,&__pyx_mstate_global->__pyx_n_u_compress,&__pyx_mstate_global->__pyx_n_u_row_compress,&__pyx_mstate_global->__pyx_n_u_note,&__pyx_mstate_global->__pyx_n_u_variable_value_labels,&__pyx_mstate_global->__pyx_n_u_missing_ranges,&__pyx_mstate_global->__pyx_n_u_variable_display_width,&__pyx_mstate_global->__pyx_n_u_variable_measure,&__pyx_mstate_global->__pyx_n_u_missing_user_values,&__pyx_mstate_global->__pyx_n_u_variable_format,&__pyx_mstate_global->__pyx_n_u_variable_alignment,0}; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_df,&__pyx_mstate_global->__pyx_n_u_dst_path,&__pyx_mstate_global->__pyx_n_u_writer_format,&__pyx_mstate_global->__pyx_n_u_file_label,&__pyx_mstate_global->__pyx_n_u_version,&__pyx_mstate_global->__pyx_n_u_table_name,&__pyx_mstate_global->__pyx_n_u_column_labels,&__pyx_mstate_global->__pyx_n_u_compress,&__pyx_mstate_global->__pyx_n_u_row_compress,&__pyx_mstate_global->__pyx_n_u_note,&__pyx_mstate_global->__pyx_n_u_variable_value_labels,&__pyx_mstate_global->__pyx_n_u_missing_ranges,&__pyx_mstate_global->__pyx_n_u_variable_display_width,&__pyx_mstate_global->__pyx_n_u_variable_measure,&__pyx_mstate_global->__pyx_n_u_missing_user_values,&__pyx_mstate_global->__pyx_n_u_variable_format,&__pyx_mstate_global->__pyx_n_u_variable_alignment,&__pyx_mstate_global->__pyx_n_u_variable_informat,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 995, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 999, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { + case 18: + values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 999, __pyx_L3_error) + CYTHON_FALLTHROUGH; case 17: values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 13: values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 12: values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 11: values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 10: values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writer_entry_point", 0) < (0)) __PYX_ERR(0, 995, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writer_entry_point", 0) < (0)) __PYX_ERR(0, 999, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__3))); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__4))); - /* "pyreadstat/_readstat_writer.pyx":997 + /* "pyreadstat/_readstat_writer.pyx":1001 * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", * int version=0, * str table_name=None, # <<<<<<<<<<<<<< @@ -17286,7 +17479,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":998 + /* "pyreadstat/_readstat_writer.pyx":1002 * int version=0, * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, # <<<<<<<<<<<<<< @@ -17298,7 +17491,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":999 + /* "pyreadstat/_readstat_writer.pyx":1003 * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, # <<<<<<<<<<<<<< @@ -17309,7 +17502,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1000 + /* "pyreadstat/_readstat_writer.pyx":1004 * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, # <<<<<<<<<<<<<< @@ -17318,7 +17511,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1001 + /* "pyreadstat/_readstat_writer.pyx":1005 * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, * dict missing_user_values=None, # <<<<<<<<<<<<<< @@ -17327,98 +17520,111 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1002 + /* "pyreadstat/_readstat_writer.pyx":1006 * dict variable_measure=None, * dict missing_user_values=None, * dict variable_format=None, # <<<<<<<<<<<<<< * dict variable_alignment = None, - * ): + * dict variable_informat=None, */ if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1003 + /* "pyreadstat/_readstat_writer.pyx":1007 * dict missing_user_values=None, * dict variable_format=None, * dict variable_alignment = None, # <<<<<<<<<<<<<< + * dict variable_informat=None, * ): - * */ if (!values[16]) values[16] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1008 + * dict variable_format=None, + * dict variable_alignment = None, + * dict variable_informat=None, # <<<<<<<<<<<<<< + * ): + * +*/ + if (!values[17]) values[17] = __Pyx_NewRef(((PyObject*)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 17, i); __PYX_ERR(0, 995, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 18, i); __PYX_ERR(0, 999, __pyx_L3_error) } } } else { switch (__pyx_nargs) { + case 18: + values[17] = __Pyx_ArgRef_FASTCALL(__pyx_args, 17); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[17])) __PYX_ERR(0, 999, __pyx_L3_error) + CYTHON_FALLTHROUGH; case 17: values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 13: values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 12: values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 11: values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 10: values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 999, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 999, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 999, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":999 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -17426,9 +17632,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * str table_name=None, */ if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__3))); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__4))); - /* "pyreadstat/_readstat_writer.pyx":997 + /* "pyreadstat/_readstat_writer.pyx":1001 * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", * int version=0, * str table_name=None, # <<<<<<<<<<<<<< @@ -17437,7 +17643,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":998 + /* "pyreadstat/_readstat_writer.pyx":1002 * int version=0, * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, # <<<<<<<<<<<<<< @@ -17449,7 +17655,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":999 + /* "pyreadstat/_readstat_writer.pyx":1003 * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, # <<<<<<<<<<<<<< @@ -17460,7 +17666,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1000 + /* "pyreadstat/_readstat_writer.pyx":1004 * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, # <<<<<<<<<<<<<< @@ -17469,7 +17675,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1001 + /* "pyreadstat/_readstat_writer.pyx":1005 * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, * dict missing_user_values=None, # <<<<<<<<<<<<<< @@ -17478,30 +17684,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1002 + /* "pyreadstat/_readstat_writer.pyx":1006 * dict variable_measure=None, * dict missing_user_values=None, * dict variable_format=None, # <<<<<<<<<<<<<< * dict variable_alignment = None, - * ): + * dict variable_informat=None, */ if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1003 + /* "pyreadstat/_readstat_writer.pyx":1007 * dict missing_user_values=None, * dict variable_format=None, * dict variable_alignment = None, # <<<<<<<<<<<<<< + * dict variable_informat=None, * ): - * */ if (!values[16]) values[16] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1008 + * dict variable_format=None, + * dict variable_alignment = None, + * dict variable_informat=None, # <<<<<<<<<<<<<< + * ): + * +*/ + if (!values[17]) values[17] = __Pyx_NewRef(((PyObject*)Py_None)); } __pyx_v_df = values[0]; __pyx_v_dst_path = values[1]; __pyx_v_writer_format = ((PyObject*)values[2]); __pyx_v_file_label = ((PyObject*)values[3]); if (values[4]) { - __pyx_v_version = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 996, __pyx_L3_error) + __pyx_v_version = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) } else { __pyx_v_version = ((int)((int)0)); } @@ -17517,10 +17732,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_missing_user_values = ((PyObject*)values[14]); __pyx_v_variable_format = ((PyObject*)values[15]); __pyx_v_variable_alignment = ((PyObject*)values[16]); + __pyx_v_variable_informat = ((PyObject*)values[17]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 17, __pyx_nargs); __PYX_ERR(0, 995, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 18, __pyx_nargs); __PYX_ERR(0, 999, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17531,19 +17747,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer_format), (&PyUnicode_Type), 1, "writer_format", 1))) __PYX_ERR(0, 995, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 995, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 997, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_value_labels), (&PyDict_Type), 1, "variable_value_labels", 1))) __PYX_ERR(0, 999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_ranges), (&PyDict_Type), 1, "missing_ranges", 1))) __PYX_ERR(0, 999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_display_width), (&PyDict_Type), 1, "variable_display_width", 1))) __PYX_ERR(0, 999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_measure), (&PyDict_Type), 1, "variable_measure", 1))) __PYX_ERR(0, 1000, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_user_values), (&PyDict_Type), 1, "missing_user_values", 1))) __PYX_ERR(0, 1001, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 1002, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_alignment), (&PyDict_Type), 1, "variable_alignment", 1))) __PYX_ERR(0, 1003, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_format, __pyx_v_file_label, __pyx_v_version, __pyx_v_table_name, __pyx_v_column_labels, __pyx_v_compress, __pyx_v_row_compress, __pyx_v_note, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_missing_user_values, __pyx_v_variable_format, __pyx_v_variable_alignment); - - /* "pyreadstat/_readstat_writer.pyx":995 + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer_format), (&PyUnicode_Type), 1, "writer_format", 1))) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 1001, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_value_labels), (&PyDict_Type), 1, "variable_value_labels", 1))) __PYX_ERR(0, 1003, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_ranges), (&PyDict_Type), 1, "missing_ranges", 1))) __PYX_ERR(0, 1003, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_display_width), (&PyDict_Type), 1, "variable_display_width", 1))) __PYX_ERR(0, 1003, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_measure), (&PyDict_Type), 1, "variable_measure", 1))) __PYX_ERR(0, 1004, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_user_values), (&PyDict_Type), 1, "missing_user_values", 1))) __PYX_ERR(0, 1005, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 1006, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_alignment), (&PyDict_Type), 1, "variable_alignment", 1))) __PYX_ERR(0, 1007, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_informat), (&PyDict_Type), 1, "variable_informat", 1))) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_r = __pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_format, __pyx_v_file_label, __pyx_v_version, __pyx_v_table_name, __pyx_v_column_labels, __pyx_v_compress, __pyx_v_row_compress, __pyx_v_note, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_missing_user_values, __pyx_v_variable_format, __pyx_v_variable_alignment, __pyx_v_variable_informat); + + /* "pyreadstat/_readstat_writer.pyx":999 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -17568,7 +17785,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_writer_format, PyObject *__pyx_v_file_label, int __pyx_v_version, PyObject *__pyx_v_table_name, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_alignment) { +static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_writer_format, PyObject *__pyx_v_file_label, int __pyx_v_version, PyObject *__pyx_v_table_name, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_alignment, PyObject *__pyx_v_variable_informat) { int __pyx_v_file_format_version; int __pyx_v_row_compression; __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_v_writer_file_format; @@ -17587,7 +17804,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __Pyx_RefNannySetupContext("writer_entry_point", 0); __Pyx_INCREF(__pyx_v_note); - /* "pyreadstat/_readstat_writer.pyx":1007 + /* "pyreadstat/_readstat_writer.pyx":1012 * * * cdef int file_format_version = 0 # <<<<<<<<<<<<<< @@ -17596,7 +17813,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0; - /* "pyreadstat/_readstat_writer.pyx":1008 + /* "pyreadstat/_readstat_writer.pyx":1013 * * cdef int file_format_version = 0 * cdef bint row_compression = 0 # <<<<<<<<<<<<<< @@ -17605,17 +17822,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_row_compression = 0; - /* "pyreadstat/_readstat_writer.pyx":1012 + /* "pyreadstat/_readstat_writer.pyx":1017 * cdef dst_file_format writer_file_format * * if writer_format == "sav": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_sav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_sav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1013 + /* "pyreadstat/_readstat_writer.pyx":1018 * * if writer_format == "sav": * writer_file_format = FILE_FORMAT_SAV # <<<<<<<<<<<<<< @@ -17624,7 +17841,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV; - /* "pyreadstat/_readstat_writer.pyx":1014 + /* "pyreadstat/_readstat_writer.pyx":1019 * if writer_format == "sav": * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 # <<<<<<<<<<<<<< @@ -17633,25 +17850,25 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 2; - /* "pyreadstat/_readstat_writer.pyx":1015 + /* "pyreadstat/_readstat_writer.pyx":1020 * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 * if compress and row_compress: # <<<<<<<<<<<<<< * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1020, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1020, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":1016 + /* "pyreadstat/_readstat_writer.pyx":1021 * file_format_version = 2 * if compress and row_compress: * raise PyreadstatError("compress and row_compress cannot be both True") # <<<<<<<<<<<<<< @@ -17659,7 +17876,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT * file_format_version = 3 */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -17678,14 +17895,14 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1016, __pyx_L1_error) + __PYX_ERR(0, 1021, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":1015 + /* "pyreadstat/_readstat_writer.pyx":1020 * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 * if compress and row_compress: # <<<<<<<<<<<<<< @@ -17694,17 +17911,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ } - /* "pyreadstat/_readstat_writer.pyx":1017 + /* "pyreadstat/_readstat_writer.pyx":1022 * if compress and row_compress: * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: # <<<<<<<<<<<<<< * file_format_version = 3 * if row_compress: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1022, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1018 + /* "pyreadstat/_readstat_writer.pyx":1023 * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: * file_format_version = 3 # <<<<<<<<<<<<<< @@ -17713,7 +17930,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 3; - /* "pyreadstat/_readstat_writer.pyx":1017 + /* "pyreadstat/_readstat_writer.pyx":1022 * if compress and row_compress: * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: # <<<<<<<<<<<<<< @@ -17722,17 +17939,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ } - /* "pyreadstat/_readstat_writer.pyx":1019 + /* "pyreadstat/_readstat_writer.pyx":1024 * if compress: * file_format_version = 3 * if row_compress: # <<<<<<<<<<<<<< * row_compression = 1 * elif writer_format == "dta": */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1019, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1024, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1020 + /* "pyreadstat/_readstat_writer.pyx":1025 * file_format_version = 3 * if row_compress: * row_compression = 1 # <<<<<<<<<<<<<< @@ -17741,7 +17958,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_row_compression = 1; - /* "pyreadstat/_readstat_writer.pyx":1019 + /* "pyreadstat/_readstat_writer.pyx":1024 * if compress: * file_format_version = 3 * if row_compress: # <<<<<<<<<<<<<< @@ -17750,7 +17967,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ } - /* "pyreadstat/_readstat_writer.pyx":1012 + /* "pyreadstat/_readstat_writer.pyx":1017 * cdef dst_file_format writer_file_format * * if writer_format == "sav": # <<<<<<<<<<<<<< @@ -17760,17 +17977,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1021 + /* "pyreadstat/_readstat_writer.pyx":1026 * if row_compress: * row_compression = 1 * elif writer_format == "dta": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_DTA * if version == 15: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1022 + /* "pyreadstat/_readstat_writer.pyx":1027 * row_compression = 1 * elif writer_format == "dta": * writer_file_format = FILE_FORMAT_DTA # <<<<<<<<<<<<<< @@ -17779,7 +17996,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA; - /* "pyreadstat/_readstat_writer.pyx":1023 + /* "pyreadstat/_readstat_writer.pyx":1028 * elif writer_format == "dta": * writer_file_format = FILE_FORMAT_DTA * if version == 15: # <<<<<<<<<<<<<< @@ -17789,7 +18006,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT switch (__pyx_v_version) { case 15: - /* "pyreadstat/_readstat_writer.pyx":1024 + /* "pyreadstat/_readstat_writer.pyx":1029 * writer_file_format = FILE_FORMAT_DTA * if version == 15: * file_format_version = 119 # <<<<<<<<<<<<<< @@ -17798,7 +18015,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x77; - /* "pyreadstat/_readstat_writer.pyx":1023 + /* "pyreadstat/_readstat_writer.pyx":1028 * elif writer_format == "dta": * writer_file_format = FILE_FORMAT_DTA * if version == 15: # <<<<<<<<<<<<<< @@ -17808,7 +18025,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 14: - /* "pyreadstat/_readstat_writer.pyx":1026 + /* "pyreadstat/_readstat_writer.pyx":1031 * file_format_version = 119 * elif version == 14: * file_format_version = 118 # <<<<<<<<<<<<<< @@ -17817,7 +18034,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x76; - /* "pyreadstat/_readstat_writer.pyx":1025 + /* "pyreadstat/_readstat_writer.pyx":1030 * if version == 15: * file_format_version = 119 * elif version == 14: # <<<<<<<<<<<<<< @@ -17827,7 +18044,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 13: - /* "pyreadstat/_readstat_writer.pyx":1028 + /* "pyreadstat/_readstat_writer.pyx":1033 * file_format_version = 118 * elif version == 13: * file_format_version = 117 # <<<<<<<<<<<<<< @@ -17836,7 +18053,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x75; - /* "pyreadstat/_readstat_writer.pyx":1027 + /* "pyreadstat/_readstat_writer.pyx":1032 * elif version == 14: * file_format_version = 118 * elif version == 13: # <<<<<<<<<<<<<< @@ -17846,7 +18063,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 12: - /* "pyreadstat/_readstat_writer.pyx":1030 + /* "pyreadstat/_readstat_writer.pyx":1035 * file_format_version = 117 * elif version == 12: * file_format_version = 115 # <<<<<<<<<<<<<< @@ -17855,7 +18072,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x73; - /* "pyreadstat/_readstat_writer.pyx":1029 + /* "pyreadstat/_readstat_writer.pyx":1034 * elif version == 13: * file_format_version = 117 * elif version == 12: # <<<<<<<<<<<<<< @@ -17865,7 +18082,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 10: - /* "pyreadstat/_readstat_writer.pyx":1031 + /* "pyreadstat/_readstat_writer.pyx":1036 * elif version == 12: * file_format_version = 115 * elif version in {10, 11}: # <<<<<<<<<<<<<< @@ -17874,7 +18091,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ case 11: - /* "pyreadstat/_readstat_writer.pyx":1032 + /* "pyreadstat/_readstat_writer.pyx":1037 * file_format_version = 115 * elif version in {10, 11}: * file_format_version = 114 # <<<<<<<<<<<<<< @@ -17883,7 +18100,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x72; - /* "pyreadstat/_readstat_writer.pyx":1031 + /* "pyreadstat/_readstat_writer.pyx":1036 * elif version == 12: * file_format_version = 115 * elif version in {10, 11}: # <<<<<<<<<<<<<< @@ -17893,7 +18110,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 8: - /* "pyreadstat/_readstat_writer.pyx":1033 + /* "pyreadstat/_readstat_writer.pyx":1038 * elif version in {10, 11}: * file_format_version = 114 * elif version in {8, 9}: # <<<<<<<<<<<<<< @@ -17902,7 +18119,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ case 9: - /* "pyreadstat/_readstat_writer.pyx":1034 + /* "pyreadstat/_readstat_writer.pyx":1039 * file_format_version = 114 * elif version in {8, 9}: * file_format_version = 113 # <<<<<<<<<<<<<< @@ -17911,7 +18128,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x71; - /* "pyreadstat/_readstat_writer.pyx":1033 + /* "pyreadstat/_readstat_writer.pyx":1038 * elif version in {10, 11}: * file_format_version = 114 * elif version in {8, 9}: # <<<<<<<<<<<<<< @@ -17921,7 +18138,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; default: - /* "pyreadstat/_readstat_writer.pyx":1036 + /* "pyreadstat/_readstat_writer.pyx":1041 * file_format_version = 113 * else: * raise PyreadstatError("Version not supported") # <<<<<<<<<<<<<< @@ -17929,7 +18146,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT * elif writer_format == "xport": */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1036, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -17948,26 +18165,26 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1036, __pyx_L1_error) + __PYX_ERR(0, 1041, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_writer.pyx":1037 + /* "pyreadstat/_readstat_writer.pyx":1042 * else: * raise PyreadstatError("Version not supported") * note = "" # <<<<<<<<<<<<<< * elif writer_format == "xport": * writer_file_format = FILE_FORMAT_XPORT */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__3); - __Pyx_DECREF_SET(__pyx_v_note, __pyx_mstate_global->__pyx_kp_u__3); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__4); + __Pyx_DECREF_SET(__pyx_v_note, __pyx_mstate_global->__pyx_kp_u__4); - /* "pyreadstat/_readstat_writer.pyx":1021 + /* "pyreadstat/_readstat_writer.pyx":1026 * if row_compress: * row_compression = 1 * elif writer_format == "dta": # <<<<<<<<<<<<<< @@ -17977,17 +18194,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1038 + /* "pyreadstat/_readstat_writer.pyx":1043 * raise PyreadstatError("Version not supported") * note = "" * elif writer_format == "xport": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1039 + /* "pyreadstat/_readstat_writer.pyx":1044 * note = "" * elif writer_format == "xport": * writer_file_format = FILE_FORMAT_XPORT # <<<<<<<<<<<<<< @@ -17996,7 +18213,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT; - /* "pyreadstat/_readstat_writer.pyx":1040 + /* "pyreadstat/_readstat_writer.pyx":1045 * elif writer_format == "xport": * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version # <<<<<<<<<<<<<< @@ -18005,7 +18222,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = __pyx_v_version; - /* "pyreadstat/_readstat_writer.pyx":1038 + /* "pyreadstat/_readstat_writer.pyx":1043 * raise PyreadstatError("Version not supported") * note = "" * elif writer_format == "xport": # <<<<<<<<<<<<<< @@ -18015,17 +18232,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1041 + /* "pyreadstat/_readstat_writer.pyx":1046 * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version * elif writer_format == "por": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_POR * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1046, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":1042 + /* "pyreadstat/_readstat_writer.pyx":1047 * file_format_version = version * elif writer_format == "por": * writer_file_format = FILE_FORMAT_POR # <<<<<<<<<<<<<< @@ -18034,7 +18251,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR; - /* "pyreadstat/_readstat_writer.pyx":1041 + /* "pyreadstat/_readstat_writer.pyx":1046 * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version * elif writer_format == "por": # <<<<<<<<<<<<<< @@ -18044,7 +18261,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1044 + /* "pyreadstat/_readstat_writer.pyx":1049 * writer_file_format = FILE_FORMAT_POR * else: * raise PyreadstatError("wrong writer format") # <<<<<<<<<<<<<< @@ -18053,7 +18270,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ /*else*/ { __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -18072,25 +18289,25 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1044, __pyx_L1_error) + __PYX_ERR(0, 1049, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":1046 + /* "pyreadstat/_readstat_writer.pyx":1051 * raise PyreadstatError("wrong writer format") * * run_write(df, dst_path, writer_file_format, file_label, column_labels, # <<<<<<<<<<<<<< * file_format_version, note, table_name, variable_value_labels, missing_ranges, missing_user_values, - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) + * variable_alignment, variable_display_width, variable_measure, variable_format, variable_informat, row_compression) */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_file_format, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_file_format_version, __pyx_v_note, __pyx_v_table_name, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_missing_user_values, __pyx_v_variable_alignment, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_variable_format, __pyx_v_row_compression); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_file_format, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_file_format_version, __pyx_v_note, __pyx_v_table_name, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_missing_user_values, __pyx_v_variable_alignment, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_variable_format, __pyx_v_variable_informat, __pyx_v_row_compression); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":999 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -18176,7 +18393,7 @@ static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error) #endif - const char * __pyx_export_name = __pyx_export_signature + 1032; + const char * __pyx_export_name = __pyx_export_signature + 1044; void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_write_bytes, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_open_file, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_run_write, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_close_file, (void (*)(void))&__pyx_f_10pyreadstat_16_readstat_writer_initial_checks, (void (*)(void)) NULL}; void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers; const char *__pyx_export_current_signature = __pyx_export_signature; @@ -18699,426 +18916,426 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_2) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":31 - * + /* "pyreadstat/_readstat_writer.pyx":32 * from readstat_api cimport * + * from libc.errno cimport errno * from _readstat_parser import ReadstatError, PyreadstatError # <<<<<<<<<<<<<< * from _readstat_parser cimport check_exit_status * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ReadstatError,__pyx_mstate_global->__pyx_n_u_PyreadstatError}; - __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_imported_names, 2, __pyx_mstate_global->__pyx_kp_u_pyreadstat__readstat_parser, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_imported_names, 2, __pyx_mstate_global->__pyx_kp_u_pyreadstat__readstat_parser, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ReadstatError,__pyx_mstate_global->__pyx_n_u_PyreadstatError}; for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) { - __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":34 + /* "pyreadstat/_readstat_writer.pyx":35 * from _readstat_parser cimport check_exit_status * * cdef set int_types = {nw.Int32, nw.Int16, nw.Int8, nw.UInt16, nw.UInt8, } # <<<<<<<<<<<<<< * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_int_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_int_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":35 + /* "pyreadstat/_readstat_writer.pyx":36 * * cdef set int_types = {nw.Int32, nw.Int16, nw.Int8, nw.UInt16, nw.UInt8, } * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} # <<<<<<<<<<<<<< * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt128); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt128); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_float_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_float_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":36 + /* "pyreadstat/_readstat_writer.pyx":37 * cdef set int_types = {nw.Int32, nw.Int16, nw.Int8, nw.UInt16, nw.UInt8, } * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, # <<<<<<<<<<<<<< * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_nat_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_nat_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":37 + /* "pyreadstat/_readstat_writer.pyx":38 * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} # <<<<<<<<<<<<<< * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } */ - __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_t_2) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_2) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_4) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_4) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_10) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_10) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_11) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_11) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_12) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_12) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_6) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_6) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, ((PyObject*)__pyx_t_7)); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":38 + /* "pyreadstat/_readstat_writer.pyx":39 * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, # <<<<<<<<<<<<<< * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "pyreadstat/_readstat_writer.pyx":39 + /* "pyreadstat/_readstat_writer.pyx":40 * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } # <<<<<<<<<<<<<< * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, */ - __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (PySet_Add(__pyx_t_13, __pyx_t_7) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_7) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_6) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_6) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_12) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_12) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_11) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_11) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_10) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_10) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_4) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_4) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_2) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_2) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_8) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_8) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_9) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_9) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, ((PyObject*)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":40 + /* "pyreadstat/_readstat_writer.pyx":41 * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, # <<<<<<<<<<<<<< * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, */ - __pyx_t_13 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":41 + /* "pyreadstat/_readstat_writer.pyx":42 * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, # <<<<<<<<<<<<<< * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, */ - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":42 + /* "pyreadstat/_readstat_writer.pyx":43 * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, # <<<<<<<<<<<<<< * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, */ - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":43 + /* "pyreadstat/_readstat_writer.pyx":44 * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, # <<<<<<<<<<<<<< * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":44 + /* "pyreadstat/_readstat_writer.pyx":45 * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, # <<<<<<<<<<<<<< * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":45 + /* "pyreadstat/_readstat_writer.pyx":46 * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, # <<<<<<<<<<<<<< * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } * */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":46 + /* "pyreadstat/_readstat_writer.pyx":47 * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } # <<<<<<<<<<<<<< * * cdef double spss_offset_secs = 12219379200 */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types); @@ -19126,7 +19343,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":48 + /* "pyreadstat/_readstat_writer.pyx":49 * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } * * cdef double spss_offset_secs = 12219379200 # <<<<<<<<<<<<<< @@ -19135,7 +19352,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs = 12219379200.0; - /* "pyreadstat/_readstat_writer.pyx":49 + /* "pyreadstat/_readstat_writer.pyx":50 * * cdef double spss_offset_secs = 12219379200 * cdef double sas_offset_secs = 315619200 # <<<<<<<<<<<<<< @@ -19144,7 +19361,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_secs = 315619200.0; - /* "pyreadstat/_readstat_writer.pyx":50 + /* "pyreadstat/_readstat_writer.pyx":51 * cdef double spss_offset_secs = 12219379200 * cdef double sas_offset_secs = 315619200 * cdef double spss_offset_days = 141428 # <<<<<<<<<<<<<< @@ -19153,7 +19370,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days = 141428.0; - /* "pyreadstat/_readstat_writer.pyx":51 + /* "pyreadstat/_readstat_writer.pyx":52 * cdef double sas_offset_secs = 315619200 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 # <<<<<<<<<<<<<< @@ -19162,19 +19379,19 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_days = 3653.0; - /* "pyreadstat/_readstat_writer.pyx":52 + /* "pyreadstat/_readstat_writer.pyx":53 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 * cdef object date_0 = datetime.datetime(1970,1,1).date() # <<<<<<<<<<<<<< * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_8; @@ -19185,7 +19402,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_date, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_date_0); @@ -19193,17 +19410,17 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":54 + /* "pyreadstat/_readstat_writer.pyx":55 * cdef object date_0 = datetime.datetime(1970,1,1).date() * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] # <<<<<<<<<<<<<< * cdef valid_user_missing_stata = [chr(x) for x in range(ord("a"), ord("z")+1)] * */ - __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_9 = NULL; - __pyx_t_2 = __Pyx_PyLong_From_long((90 + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_long((90 + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = 1; { @@ -19211,12 +19428,12 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { { @@ -19224,28 +19441,28 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 55, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_8) < (0)) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_8) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_8 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyNumber_Add(__pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -19254,17 +19471,17 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":55 + /* "pyreadstat/_readstat_writer.pyx":56 * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] * cdef valid_user_missing_stata = [chr(x) for x in range(ord("a"), ord("z")+1)] # <<<<<<<<<<<<<< * * # max lenght of a string in dta before it has to use string_ref */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = NULL; - __pyx_t_9 = __Pyx_PyLong_From_long((0x7A + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_long((0x7A + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = 1; { @@ -19272,12 +19489,12 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { { @@ -19285,22 +19502,22 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 56, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_2) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_2) < (0)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -19309,7 +19526,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":58 + /* "pyreadstat/_readstat_writer.pyx":59 * * # max lenght of a string in dta before it has to use string_ref * cdef int dta_old_max_width = 128 # <<<<<<<<<<<<<< @@ -19318,7 +19535,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_dta_old_max_width = 0x80; - /* "pyreadstat/_readstat_writer.pyx":59 + /* "pyreadstat/_readstat_writer.pyx":60 * # max lenght of a string in dta before it has to use string_ref * cdef int dta_old_max_width = 128 * cdef int dta_111_max_width = 244 # <<<<<<<<<<<<<< @@ -19327,7 +19544,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_dta_111_max_width = 0xF4; - /* "pyreadstat/_readstat_writer.pyx":60 + /* "pyreadstat/_readstat_writer.pyx":61 * cdef int dta_old_max_width = 128 * cdef int dta_111_max_width = 244 * cdef int dta_117_max_width = 2045 # <<<<<<<<<<<<<< @@ -19336,34 +19553,34 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_dta_117_max_width = 0x7FD; - /* "pyreadstat/_readstat_writer.pyx":996 + /* "pyreadstat/_readstat_writer.pyx":1000 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", * int version=0, # <<<<<<<<<<<<<< * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, */ - __pyx_t_8 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":999 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< * int version=0, * str table_name=None, */ - __pyx_t_9 = PyTuple_Pack(15, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__3), __pyx_t_8, Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_9 = PyTuple_Pack(16, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__4), __pyx_t_8, Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_writer_1writer_entry_point, 0, __pyx_mstate_global->__pyx_n_u_writer_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_writer, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_writer_1writer_entry_point, 0, __pyx_mstate_global->__pyx_n_u_writer_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_writer, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writer_entry_point, __pyx_t_8) < (0)) __PYX_ERR(0, 995, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writer_entry_point, __pyx_t_8) < (0)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyreadstat/_readstat_writer.pyx":1 @@ -19421,7 +19638,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 735, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; @@ -19445,25 +19662,25 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "pyreadstat/_readstat_writer.pyx":674 + /* "pyreadstat/_readstat_writer.pyx":668 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< * else: * if type(filename_path) == str: */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_surrogateescape); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_surrogateescape); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "pyreadstat/_readstat_writer.pyx":52 + /* "pyreadstat/_readstat_writer.pyx":53 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 * cdef object date_0 = datetime.datetime(1970,1,1).date() # <<<<<<<<<<<<<< * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1970, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1970, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); #if CYTHON_IMMORTAL_CONSTANTS @@ -19496,34 +19713,34 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 11; } index[] = {{1},{29},{50},{4},{179},{29},{32},{21},{1},{0},{1},{1},{8},{23},{48},{66},{42},{45},{44},{59},{16},{149},{13},{8},{13},{61},{21},{70},{78},{96},{54},{66},{56},{62},{49},{68},{57},{93},{54},{29},{19},{55},{51},{12},{16},{15},{85},{39},{62},{11},{32},{27},{31},{19},{29},{16},{13},{14},{19},{54},{23},{19},{5},{15},{57},{67},{37},{37},{37},{19},{7},{11},{4},{8},{7},{4},{7},{7},{6},{5},{5},{5},{4},{6},{15},{20},{13},{6},{4},{7},{6},{6},{6},{5},{1},{18},{4},{3},{6},{17},{18},{5},{13},{7},{7},{8},{4},{8},{10},{4},{2},{7},{10},{8},{3},{5},{10},{6},{10},{19},{10},{6},{11},{8},{8},{8},{3},{14},{20},{21},{2},{14},{13},{5},{9},{9},{7},{5},{4},{5},{12},{9},{4},{4},{2},{8},{3},{14},{19},{10},{2},{4},{8},{18},{7},{4},{2},{2},{2},{3},{10},{5},{2},{7},{2},{4},{3},{3},{27},{12},{12},{16},{7},{5},{5},{12},{15},{3},{5},{12},{10},{6},{15},{3},{10},{8},{4},{4},{9},{9},{8},{13},{6},{7},{5},{2},{3},{2},{6},{18},{22},{15},{16},{21},{7},{4},{8},{4},{12},{18},{18},{13},{1},{5},{3},{1370},{310},{306},{41}}; - #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2357 bytes) */ -const char* const cstring = "BZh91AY&SYk=(\314\000\001\\\377\377\346o\376\307v\367\375v\277-\377\320\277\377\377\361@@@@@\000@@\000@@@@\000@\000`\n\017\225\224\366sXt\005\022P(\240\350\006 \252\256BQ&!O\3254\236iOQ\352<\231OH\000\r7\252d\006\236\240\007\250\364\207\250=O\3256\247\250`\322~T\022H\000Bjz#I\224\003@\000\000\032\000\000\000\001\240\036\240\007\000\003A\241\240\320\001\246A\241\2204\320\000\001\220\001\220\031\000\006\236\245\010\200d\000h\r4\321\2402\000\000\310\000\000\000\000\000p\0004\032\032\r\000\032d\032\031\003M\000\000\031\000\031\001\220\000H\210M\002\023L\247\224\364\231M\244\323$\321\204hi\243j\032\000\000\000hhh\036\246\227\224\274\361\234q#\024\305\216\210\212\006\214B\214MC\356\240\252\013\023\025\253\300\207\r4\350|\244\004\264\035mn\007,\n\372a\034*B.v\00733\302\212\256k\274\344b\226\017\211\340\016P\217}\3107\373~/\007\2654\024\270`\003\217\222\327\205q\317\317=\016d\340&\221+\237#\204\276K\000X\362\345n\276\352m\310\331\n\312!\005Dm\022\215i]6\317\226\326l\276\377\213u\313d\362\210yE\014=\037c\256\246#P\377\251\245\016\377\253I@h\267.N\r\"1\035:\304b=S\216\\\320\225R\236\234\215\n\341\321\032Sq\001\242\261\200\234{2\214\327\254\330.\335C\343&\233\327,\342Y\277{\247H\312\261\263\010\271Ks\031VV\267RO:\323\007M\013\024\3067\276\346X\302\370\232K\251II\343\370X\337\n\032\271\313\177s\226\313y\356a\237\301\351^\362\245\231\245\340\210Y\335(\377\273\251\"\243\2000i\264\332'2\362\355\r\246\364\245&\003\010\"\026\374\375m\250\312\346\257\005\347\212\030\240\357B\216\331\371\261\336\005:\215\361c\034\262\335W\324\005\212\032\333\205\202:\341c\004m\006\031\n\265\254\002\360\r\037\333b\014z\tP`\330\236\372\264\177\247\205\373,\220\022Cquq\233.\230\342O'\310\215\005\353\320\362\367\340;\2178^F \261\325a\220\210\210\rp2\320h8+$\266z\031dq\314\005\227\215M\307\232\240\262\361\263Tk8`\263\241\277\0358%\010\370t\361\226\276&\036\2469\025\243\332\315)\003c\243\253\027G4\033\033 \263\304\031\247\3370\266\016\243\030A\264G\372i#|\321T\327\277U\246f\237\330\220V\346\211\357\353\266T\246\345\256ri\2037$\241=Z\355\252\326$\272\022\323\201<\016\002H\245\327|\373\233B\3337\202\305\252\232\214fS\245\356\216o\310'V\341\243\234\355f\240\300%\255A\226\210\301(3fu\365\366\221H\014n5\303\026v\260\214\343\305xNK4\245\216\307>1K\343\324\207\033\267\343\224f\2503&\241'\231\325*\260>\362\333\\\372\272UuF\254\217\343\004\314\352[\256\341a\353\337}\370\010\253bc\022mW\2740\310)D\222\215 \245a\n\370\256\274.Wb2\031B\021)`\0071\211\263\211\332\020J\035Z\010L\226\224\2508\311\223\201\364Xl\001N\350J\035\r\347\216ao\014\2443h\271\203<\211*>\2333_\361\2407\355X\"_\036\033y\266\353\247a\007}7z\215\0248\322|\010\010\345#\317\303\246\273\024\241\213\335c\347\303]\032\032\333\236\252\341\247JX\251\246\310\330\200\336{\214""\310\212\232a\001v\220\331\320Y\245\231e\304\261%\300H%\271r\230%QB\344\231\031!\267\023\031\034\035\2614\376#\356a!\260\274AI\202Rl`P\364_\\\361\316\205\356\3642\031\245CJ\005X\241\222\267{e\212f&]1\2468\210\271y@\266$R\373`\253\246\230nH\321\2000\233%S\021Y\264\320\300ombF]\325\314\351\245\004\3452TSf\340\036V-\013\305\256\221KY\027\234SF\342D\225Kp\224\342\304\024\360Q\225pM+R\215\224\211\232\222\342\370\321\0276\316Km\010\301\373\014\203\010/\331\232Z$M\241\331\262\354\201\2446\010\224\223EV%\244~\206\233\2672\230\027\367\331\342k\255\250dg\256\357(\247\034\367\303:L\222\321F#\312\"\222\271>=P[\311\247\300\303h\207~\\\363\016O.v7\264\307\244@\231\330\007WMDe\347\016\013\313\251\177\240\320Y\234\306\207\257\006\370\002vP\301Y2\030\366/\0311/>)\262+d\241\000\010\006B\205\005\314\026\227\206\213\222\301!jb\332\332t\3007\211\265\2037\263pxy\361\317\253X\251(\320W\024{\\y\367\034:\374\354\205\333\024\315\"\325\0162\036\256\243\213\341\335\263,_VKO\036\254\2721CC\335\\\375]jW\362\001\256\251\035;z\370f\0358u%-\2661\251\"\023]D\020\332i6\230\322M\314@\242\201\31033B\255\226\023\264A\333\007\341b4\335\213\342\217\t\216f\250\023KM\223$\336!Q\006=\311\004\211(\262\313m{%a\201\217\032\354\246m\351\352\221\243cM\212\2206\375\2164\240\263 \032C\361<\315wO\026\276\026\035\315\214\243\305\304A\030\336J2l\346\362w\355v\304i4\324y\343\014b\271R\215\221I\231)3=f\375\021\243\373\312\231Z4+\313\253\343\206\333)nC\215KX\315@\311\317@Df\263v\363\204y\263\206\225\322\220\2343\216\250{\351g\230\347L\303\234M\000\354\332\332!\020fO\342\227h[\232\031\250\210\014\321k\334\242\235\250\244\310(\30127nM\374\327\266\313\\\177Mm\256\360\301\032\366!\007]jn\306\222\300m\264\017\010N\221/\224*\331\341\\\025\332\253\032<\225\255+T\020\r\215\203T\362uM@`R\327\250\335$NA\221\235% \220\353\200\307:\t\007\302\3213\005\016\030\342\312\224%\205I\2469U\025,\335\235\001\335\304@\007\016+[\244ffq\300\311\326\00729\211\340\233_Q\242\364K<\255\272\231\"\315\266\331\202m\276\234s\335\241\251\205\252\2538""\340\351T\270\260()\304\036\311l\307\t\317\024\213\344i;Yf\331\263\004fn\205\t\274\361\353\364\311\021\232E\030\227\232\205.]\222QHe-e{\262q\033\216\031m\020\267@\221X\322S:\306\260\026 \322lk\315\t\034\375\2352\313\213\2718\034\267\370\016\324\325\255\274)\351\277\232\373\327$\307\013`\254\3132#\0213\355\016\227\201,\307\017!;\003\306`3]\321\030fs\211\217pH(\374W\2454\246j\340\020#\006\005\356\354\216\305\354\325\036\242\022rP\224\222\257\235\001\366\247w6\256r\376\212\267\320\311\221:\373j\223\234\324\336\301\302\234\nq%\233\237\023G\020\242q\373|\330i\252\276|\330j\315\342\311\213p\324(\177\310\345N\306\255*fp\357Z\2722 \243\255\221^j\366\371K\305\257o\376.\344\212p\241 \326zQ\230"; - PyObject *data = __Pyx_DecompressString(cstring, 2357, 2); + const struct { const unsigned int length: 11; } index[] = {{29},{21},{50},{4},{179},{82},{29},{32},{21},{1},{1},{0},{1},{1},{8},{23},{48},{66},{42},{45},{44},{59},{16},{8},{149},{15},{13},{8},{13},{61},{21},{70},{78},{96},{54},{66},{56},{62},{49},{68},{57},{93},{54},{29},{19},{55},{51},{12},{16},{15},{85},{39},{62},{11},{32},{27},{31},{19},{29},{16},{13},{14},{19},{76},{23},{19},{5},{15},{57},{67},{37},{37},{37},{19},{1},{7},{11},{4},{8},{7},{4},{7},{7},{6},{5},{5},{5},{4},{6},{15},{20},{13},{6},{4},{7},{6},{6},{6},{5},{18},{4},{3},{6},{17},{18},{5},{13},{7},{7},{8},{1},{4},{8},{10},{4},{2},{7},{10},{8},{3},{5},{10},{6},{10},{19},{10},{6},{11},{8},{8},{8},{3},{14},{20},{21},{2},{14},{13},{5},{9},{9},{7},{5},{4},{5},{12},{9},{4},{4},{2},{8},{3},{14},{19},{10},{2},{4},{8},{18},{7},{4},{2},{2},{2},{3},{10},{5},{2},{7},{2},{4},{3},{3},{27},{12},{12},{16},{7},{5},{5},{12},{15},{3},{5},{12},{10},{6},{8},{15},{3},{10},{8},{4},{4},{9},{9},{8},{13},{6},{7},{5},{2},{3},{2},{6},{18},{22},{15},{17},{16},{21},{7},{4},{8},{4},{12},{18},{18},{13},{1},{5},{3},{1382},{310},{312},{41}}; + #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2445 bytes) */ +const char* const cstring = "BZh91AY&SY\361\217\253\334\000\001\345\377\377\346o\376\307v\367\375v\277-\377\220\277\377\377\361@@@@@\000@@\000@@@@\000@\000`\no\275\266\272\254\341\030T)tS@T\212*\254\306@\256BSR\233AOTi\342i\250\364\315D\361A\3524\003\311\000\036\240\017P\3653Pg\252mOP=\032Oj\203D\320L\206T\361&D11\014\021\220\310d\320d\301\030\000\023F@\300Lp4\r\000\32044\000hd4\320\003M\000\320\000\031\014@\001\240\221\020A\002F\325?Q<\t\250\306\243@\320\006\214\215\000\000\000h\006\201\240p4\r\000\32044\000hd4\320\003M\000\320\000\031\014@\001\240\221 #B&\021\241\032S\324\323\3056S54h\006@\000\000\000\032\000i\246\3126a\035\311I\234\214_\031\351\023\220\016b|P1\366@\220*NP,\354qi\323\241\361\020\022h8\265\274\034\230\024\370a\034\250@\256w\243\241\203\265\024]\027P\334b\225\336\337Q\356\016\224\n\\\203\347\217\257\275\273\312\232\n\\4\001\323\236\376\0319\255E\026l\023\275\330\030\033Pt\217\2068F\347\222J\nH\326\376\373\373\234-\345\223;\365\t\020\215\032&\310h\2326\225+\256\371p\265\233-\307\371u\\\256o8\207\234L\267\325\372\374\252b5\017\3645\340M#\261\374\353\255\007g\236\350\322\326\273\014\261\257\204\255IX\356\322\345K\245]\3329\337\021A\326\320LtO\030\010\377\027\257\301:\335}\247\251\243\350J\2257![s\004\016y\311Np\245\352\202E\353\200l\327\001\206\030c H\021\267\032\3045\340\2519e.\017\301\223\035\213\344i'2\365\254\211r\314\345;\233\242\027.\223\236e\215\240\"U:\n\203Z\233\026\246\224e8\210\231\305A@\247a\213\032\024\201\266(\330\215t\240\0167\314\313A\334\233\256\367\246\325\323\325)^=K\322\230\274\311z\375\035\353\265\236\336f\376\257Bj\216\313\033\032h4\303\033\325\001\n\263n{ G\202\365w\032M\266\330\332\006\241\367\234\211\355\313\244SEo\367\35680\370y\370/\256\330\234\0145bD\"\256\252\021\335\003\013\202\360\017\004\0047\346\377\024H>\363hk\362\222\267/_\337\0360\247\013T\345\014C\333\306\364\245\202\231j\275v\032\267\302\344v\350\352kY\346M)\035\332\306\325\213\220k\222\221`\227\345\316\201~\346S(T\n\3245z\267\252\325\031\202^\010\210\253h\3536G\211\t3$$\311\t$3\253Coa\213+m""\373\221\227&\007]N*\324\261b\305\271f$v\257\337\202\261\337-\276\356 \365\344\336}\315\223\315\036\237g\257\307El\303\210fTZ\035\216\323\214t\327\257r\331z\276\005\351*Y\231\341\004B\317\004\243\374\327I\025\034\001v\233M\242s0\221\332\033M\350\245&\002\360D-\354\374]h\313\003K\272\353E\014Pr\241G|\275Q\344\002}G\010\251\226y\357\243\352\002\244\315k\312\241\034ae\004n\006\031\212\224\244\002\3464\177]\220e\332%1\241\261>Y:\177\311\006?\233H\n\241\364\214\264\331\256\372iY\026\340\215\302\373\027#\216\003\303\350\013\310\304\0257\324d\"\"\003K\027\303m\007\025T\226\276\334\340\2529a\002\317\310\245\220\360\246,9\031\245\032f\367Y\320\353c\243}(A\3122\030\r\266\233H\305\241\205\245\037\003Gg\301N3(\300\325\033\362\031\220(h\365ho\222[\357\350^\227\303\264\337\020\271D`\216\026C;\351 \204U\200\252\227\020\354\006\307\244\227G\262,\2511\272\304\371}\313(/\247&c\214S\250>\255\356\025k\005\242m\016\\G\2334c\222\013:\276z\021%D\203P\333\321\r5\002\325\013#k\244\262\002FB\253\r\262bKX\205\"d\0332\362o\236\301\263C\303<\340\2433gz\252\211\366\301\245C9n\226T\025\252 %\333\276Y\316\336\346\2731tyDma\004\"w>\007)9\247B\304\252\355\264]\252\227j\014\n(\245!\334\255\215qT\371\241\323\224\264\341\216o\016L\263-G\255\232i\003c\243\253\027\206\346ccd\025f\001\230\373\245\253gA\214 \320G\372i#\204\246\250S\203QJ\"]\204D\003\347\022$\217\225\221{\322\350\252\222\033\2003\255\253ugA\326U\260\251\336\226\376e\264 \n\242\370^\364\243\007(\317\223\371L\317$\356\315\213\370\245\024\332Z\204\354\333\206.\222\334\315A\200I\255A\225\210\262Pb\260|\2751|\375;\311Z\002\370\032\347\243<\030F\321\343\274'\"\255)1\324\355\353\211\337-\212\214\224\222\262\023\252\202x3#\2305\004\236D\363\001(m\252\345\323\341'\326B\263!\321Acl\214\301\213\017O-\272\252\221F\304\306$\335\030\374\241l\202s\000#\020N\220\205|\227\013\\\246\250\314d\310D\222\260\034\306&\316G\020A(u\032?\266\022\231F\202\212\r\262f\340|\013\rh\024\357A\014S8\036YB\342\031\3100\321r\314\366\020\023}\333anh\016\033\225\221'\317\226""\356\306\3354\356 \247\226\233\374\215\0249\316%\326\200\227d\207~\3355\331I\014^F>\234\264\320hkv5W\r;\247R\206\233F\302\016\007\270\314\310\242\322\320\027i\r\235\302\300\030\223\252\346T\232\346\222\n\373\277\367\202\350=\213\340R\363ld\321\275\017\211q\243\244u\227R\357R\320\334\206\304\306\027\210'($\223m\260&{\367\333\031be\356\3643\031\245\003I\205\030\241\222\\~a\025'\2012\351\2151\304E\313\311\002\331\"yo\202\216z[\212F\032\001\204\262\311T\304Vm40\033\327h\221\230'#\004\332\021D\223E\226e\244?}\246\353\342'b\271}&.-\030dc]\367\363\212y\351\302\031\335)\022h\233\021\347\0219.\307\317\204\025\363k\3570\336!\337\263\246\003\233\317\245N/\223 z\304\t\226}\340p\356\330E=\220\346\275\033\027\367Z\n\263Q\241\353\311\307\216\340T\235]z_lXO\233\265]\2366\310\330i\202\033lm\241\247R\037$\364\307\224\325v+\202S3yB\336w\\4I\260\27383x>\323\247=:\365\332U$\215EqG\257\257\247\201\317\227\245\220\274q<$T\242:\344\037\037Q\305\355\341\266y>\031\255>6\254\272-\222!\017}q\354kB\237\214\013\352\221\337\341\307\226\003\277\227R\226\206\333c\032\222 \032\336 \206\323I\246\230\322M\314@\242a\330\0300\205J\2539n\020xA\370\030\2157\344\364\346\216\323\032\033\010M-6\231'\010\205D\030\362!\022\222T\233\031<\243]\370d1\304\313muOF\315}\202\rX\306\234\340N\006\337\265\316s\026\010\006\220\374O\006\275S\265\256\353\0166\306Q\342\342/$\3432Q\223g8I\314W\001\244\323RLDs\324\330-faKD@\264D\260W\"\022O3\3050d^!n\244m'd[Q\005\007\210@D\226)R\020\001\206fp?\033\226\313\221\\\237)\226\345\305\225\020D\276rZtM\221\005\204\021\263\317r\0216\324\272%\3433\354\236\312\202\003dg\214\027V\316\352\262\204\027ac\206\224\216]\230\256\325\270\376\212\335N\001dk\336$\034iC~S\223\001\266\320;D2'\022\037d*U\316\326Wj\214h\346\245iZ\240\200ll\031Nm\351\250\r\005-\205F\351\"r\014\214\351)\004\207F\003\034\350$""\035\326\211\230(o\343\213\035J\020\302\204\247\236tE\n\267W@wq\020\001\313\232\326\351\0300s\261\233\244\016R\034\242\\\223k\351\264^h\243X\316\333\347\232,\333m\260\273\345~\233o\334u\031\350\272\226n\016ql\315\005\250\246\255@\223\003\2139\332\331$_\006\262\321\225cf\326F\r\360\2417\214\270\037\014\210\214$M\211z&\257\203\r%D\206\253\325\213<5\0050@\327\032\006}\342FT\275lw\035S\026@\322lk\317\t\035=\2553\317\233.J\307g\016\266\374i\252\327\200O\313\1775\370.\026 ]\020\306\346M\025\250\234\316O\206@\266\242\t(_ \221\2605.8\213\366\323A\366\316\221\353I\005\037\212\263\236\263\320.\001\002,\300\275\335Q\222\366h\320\241\210\3531!\035\033\323\207\327O\016Y\263\033Z(\376\261\223#m\341M|\330o\345\276&\316\2166\326\263\274h\343\020\334\230\260\371\264\321O6\\4e\361|\361c5M\335\330\276\2077q\317ZQ\225\343\375\251\366\"\t\272U\024\355\013\327\342/\025\275\177\370\273\222)\302\204\207\214}^\340"; + PyObject *data = __Pyx_DecompressString(cstring, 2445, 2); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2150 bytes) */ -const char* const cstring = "x\332\305WKo\033\307\035g\200\024P\021\247M\372@zp\213QQAR \313\246,\010\252\321\242\260-\033\010Z\270rl\313E/\203\341\356\220\234jwf\2753Kju(z\324QG\035\365\021z\314G\350\221G\035\375\021\372\021\372\373\317\354\213\014%\307F\203\010\324\356<\376\357\367n>6I\221j\226\210\201L,K\013\353\330@2\353r\245G\366\231\321\254\320\352M!Y\024\340\264H\245e\261t2r2fJ37\226,\026N\014s\\\255\002C>3N\342X8\366\270tc\220P\204\221\250\201\314\205\223I\351\251\003=' \315\016\237\034\336\331\335\337eB\307,\227\377\000a\313l1\210\022a-x\231!\033\024*q\304\252\314\244\335f_\rYi\n\246%\004p\206e\200\353\"@ \315\254t^\262u\241\265q\302)\2439\320\241\324:\213U\016&j\"\t\373\251H\254\334~\245\217\265\231j\257\010\033\232<\205\360\270T\332\312\334\325\227Y9\315\025\211=\021\271\022\203DV\220G2\267\240\317\300\010rd\231\311\3114\333\177\022q\314q&E\242F:\225\332\021|\213\354\025V\256ks\266\341i8\221C\335\021\233*7f\272Ha8\273\272\031\215E.\274\331Re-\356y.\364\010\nOD\002\007\215\240\220\366\0344di\201\033~k6\370\220/\370Z\202\013\340\022\205-\260c\270f52i\226K\330\325;\305Lys\020y\203\022\336\300@\272\227y!\033\3577$3\240\tK\3242\223\210\334\266\001B\324a+\310\004\301\341\322\005U<\201\261 \327\300y\307\262\264l\254\274\020\211a\261\001\0041\227'\220uu\250\022\342\004!\"S$1\253\304\222:21\354\357\215\267f\331t\254\2421\205 \205\004\204B\350\344\314\226\326\3114\300\202\375\026syI\026\207\317\003>9\006\300\205\033\336\331\337f\207\211\024Vz\n\313\320!@N!\225\224\333\244S\353a\304\017\334\037\257\023{\3041\305/K\244\036A2l\243\245\251G\212[2&\330\007\337\267\2606\205\034E.\347\003i\336\206\017:\026\363\221\321\222\366\036k\350\023\215\220\347^\260\367\243R\005\r$\203\214\022\351\314n\246\226\212\023\326Gl\331(G\355h\220B\350*\322/\035(]\273\255\317<^u\235u\243X$\211\231\312x9\375\017\301\272\177\215T\366=(T\212\277\007\336\225\215\177(\221\257A\370 \027\026\250\201\274\"@\302U\032\371\370YZf\226!Vu\321\326\222\010J\265SO\343\205\243\242K""\261\366\220\016\377\356\227<\\=|\261\305F\340\271f\353\\ZB\374;\330\243\243\271A.kR\025\273>\275\3575\227\204\034\370-\026GmR\245E\262\005\3708,l$\240,\320\213\252;,C\313\325h\014\212\021j\277\314\267\340\346\241\273\026E\351V\312\332!\363\3558l\321p\242\220\305\276\234PY\0317\355Y\351\266\324z;\016dSxp!\267\374\323\251\324\213NojP\314\216}\005m\005\247^dBO\010\006i$zw\353i\263\250\211\210u\266Q\031.\024\354\0053U\334\006\245\2236+sx\031-\320m\363z\3053\364\020\231\267Ww\333\253\320\222\267\263\362\244\203Y+\3319BHL\307\350\365\333\330A\250\355\311N\367\262H\263\262\2637]1P\354;\273\251\3105\215F\353\241M\333P\260\020Q*I\344\010\n\242\205\353;\"\311\306(\353NE\233m\216<`\353~X\222\026\335\335\217$\260Y\022\3136 |K\013C\205\357<\215\ti\354b\353\013[\262kd\264\023H\r$\224\315D\004\0077\375\256\223\253s\210m\031 Ie\232\271\262\236\367\266\330\265\363GM\"\344\\5C=\367\360\270\277\203\207?\334\377\353\200f\315\303\306\265O\362\334\344\234\037\226'\370?@)\340\317\344\211\373Z\016\277\356\002\274\360\226z\t\216\257\002e\377\332{\345i\277\362\304\351\271\317\205-u\244\3146f\003S\300\234\022\025\303\272\010\331\353\253\001\347~^\345#H\217Y\202\266\200\341\nc*\242E\016Dt\034%\030\246\347f\266j\n\250\232e=\223Q\264\327\021_\277\367vcQ\332x\210Y\227|\036\347&\343\272H\022\013M8\345`\354DL~\221\002m\206\033\235\224a\360\221'4\274Qu\245`\344\301\364|\022F\\\177\344E\301\nJ\014s\223r\n\345\211\034\332X\022\376\320\006:\234\017\013\035q\322\017?\036U^\223\226v\001\205\373h\244\250\305\031\221\016cU=U\215\225J\263\204\366\325\374\256,o\214\211\265\322x\204I\223\026~\320T\326g\236\262\320[Y-\310\264\226b\210W\246\363k\014\264\226fK\252\307\211\341\2446\274\2347\n\373\1776\315f\217\200\250\246sg\270\037k{\241\355\205.Q\325\031\357n\333\233\000\007\235\361T\3068\327(O\216\327]\234\320\303\374u\035\324\315\020\0134\274\026\035yj6\211:n:=^\215\332\275Ey<`K\317dR{{ get\214\342N\r\036E\033u\236zC\320//t\260\337\274\r0r\326\010\370\210\346\341\023\270\207\231\307\312@\023\375\335)\264\014O\333\266\326\355-\3745N\n\202ee\305\327\212 JP,\354\275\311\026\017\274\225\272\207\260\342Hi\277\234\277\313\354\002I:\230\247Y\237|\033\261\246J\353\371[\372\000\236\247\353O\346\t7GKpk\322~\323\275\237\365\326fk\177\374\346\371\325\027\277\362\277\235\331\316\243\331\243\243\331\321\353\253\317\372\263\376\237\377\323\277\372\354\363\346\367\337\225\336\217~w\331\277\372\230]~D\353\225\177\375\363\374\305\305GW+\277\276x~\265\362\233\013q\265\362\311\331\357\317\017pt\353g\347w/?\277\\\245\223\376\325\255\3376+\202\372\361\027\347\366b\265B\373\344l\377\374\376\271\0100\237\376\322\023|\327\372\345\305/\200\332\356~~\361\320\357\336\266l\177z\366f\236\317\002\343\267+?93\027\317/\304\333\217?={~\026\237\1779\273}\357\337\267\276yH\267G\227\177\230\335}:{\352\r\261r{v{w""\266\213\355\353\331\353\277\205\222\321\304\224\364\037\005n\263\212py\242\034\247\213\302\376\01719\275\302"; - PyObject *data = __Pyx_DecompressString(cstring, 2150, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2247 bytes) */ +const char* const cstring = "x\332\305X\313n\034\307\025\035\0036\300\300rb\347\001{\241\004\305 \002I\203\032i(B`\204\004\201\236\200\221@\241\254\027\220M\241\246\273f\246\304\356\252VU5\207\315E\220%\227\\r\251O\310\322\237\220\345,\271\324'\344\023rnUwO\317xHYB\014\023dw\275\356\373\324\275\267y\337de\256Y&\2062s,/\235gC\311\234\267J\217\335}Sf)\323\3063SH\315F*\223l\343\261\321\254\324\352u)Y\022\211\265\310\245c\251\3642\3612eJ3?\221,\025^\214,\266\326A!\037\033/\261,<\273_\371\tX(\242\310\324PZ\341eV\005\221 \267tH\263\375\207\373\327w\367v\231\320)\263\362\025\030;\346\312a\222\t\347 \313\214\330\260T\231'QU!]\237}3b\225)\231\226P\300\033V\340\\\227\000\ni\346\244\017\232m\010\r\233\204WFs\220\303\322\r\226*\013!\352P\022\365#\2219\331\337\352\263g8\035\254\316EE~\311Lr\000\001\303\n\212\031\260\262\254\260&\221\220el\220O\347\310_\023\001NS\253`t!m\256\234\203\260\376s}\240\315T\007\327\260\221\2619\334\001qJ;i}\263YT\201\316\262Ca\225\030Bx<\371BZb\022\330\273\262(\214\205\263\267X\377/\"M9\026\245\310\324X\347R{\"\230S\007\037*\337\215-\333\014L\274\260\360\340\230M\225\2370]\346\210\205[\337J&\302\212\020\211\240\266\036s+\364\030><\024\031b>\206\217t\220\240\241\314\374p+\357\232\213\260\340K\230\222*8,S\230\202:E\264\327\023\223\027\226\334\027\342l\246\274]HB\214\210n\010G\263g\266\224-\240Z\226\005\310D\360}a2a\335\034s\304\035\316\202NP\034(Y2%0\0101\"<\034\310\312\261\211\nJd\206\245\006'H\270<\202\256\353lSZ\253M\304A!\240L\322^\0132K'&\005&\202\023\25796\235\250dB\350&\264A9\240\3022W9/\363x\026jl3o+\362<\202\037\351)@8\\\372\321\365\275>\333\317\244p2pXE\016\005,\2415\253\372\033!\022\004\030\254\337ad\352<\360\300\025P\221n\2206\2701tSX&\365\030\212b\232\254\274\371\344\017G>\2066\021\022\363\263.\207Z\245\225\213\370Zt\355\235\216#\003`\346\254C [\376\304#\246\231\240\330\373q\251\261\004\315\240\243D\342`\227s\313\305\021\033\000r.\261\310R-QD\264\"\373\362\241\322M\024\007,\320\325\333E\027\334\"\313\314T\246\253\371\177\010\325\255\013\264r\357\301\2416\374=\350\026)jL""\004\017\327\250\306m\0327\271xo\231\272&\003\326\332kV\265\361\241\373}\001\301\007\205\260Dn\3445\003R\256\266(\340ge\366YEX\347K\327h\"\350\346\035\007\036O=%c\302\332]Z\374G\030\362\270u\367\3516\033C\3465\327\334\245\025\314\177\200?:\226\033\\mM\246b6\240\367\315v\223\210\243\274\345\234\251M\256\264\310\266q>\215\003\227\010\030\013\362\262\256\032\253\310\254\032O\3001AI\220v\033a\036\371\013I\224\236k\331\004d\261\033\210S\024\242$\336\342\220N(\255L\332F@\351y\006\016~\034\3126\361`Cn\207\247WyP\235\336T\267\230\233\204\204:W\234J\224\211\245\":\244\325\350\335\025i~\213ZDl\260\315\332q1\177/\271\251\2266\254\274tEe\021eTF\337\347\315\210\027(-\322\316\267n\314\267b\251\356\027\325Q\207\2621\262\263\004HL'\350*\372\230A\251\376\341Nw\263\314\213\25237]5\220\373;\263\251\260\232:\263\215X\275]LX@\224\31229\206\201\233\272\266Jd\305\004\251\335\303\025\032\326\tj\332R\024x\324\016\2715\2779w\330Fh\326\244C\005\t-\021<\231\341`\013\223P\367b\013\022\312S\353Xj\373\330\306\322\224\274\235\030\355\005.\014\256\231+D\202\260\267E\261s\203\027\010\347\311\0011\274.\363\302WM\023\272\315.lV\032\026\361&\326\r\307\235\026\231\177\2439{\307\241\027\001C\027\034\212\000#h\241G@\2315\244@\354\316\242G\370\275x\243\357#\344c\003\334\211\354\001\206\017j\004<\220\211\312E\366\020\372>\312\214\360\267v\302\353\366\3567\332\017v\366\350y\033\217[;x\204\305\275\277\017\251\331\335o#\376\320Zc9\337\257\216\360\367\000\031\202?\226G\376[9\372\266{\340ip\3253H|\0369\207\327\355\347\201\367\363\300\234\236{\302U:Q\246\017\020\230\022\356\224\310#\316'\270\323!Gp\036\372e>\206\362h8h\2123\\\241M\006Z\344P$\007I\206f~\241\301\253{\203\272\2046\r\\J\227\240\271\010\315\373\366n**\227\216\320lS\320Sk\n\256\313,s\260\204\323\325L\275H)0R\240\372p\243\263*\266G\362\210Z=J\272\204F^\373\3760v\304a)\350\202\021\254\030Y\223s\302\362\241\034\271T\022\375\310E>\234\217J\235p2\020\277<\251\243&\035\315\"\t\017p$\330b\215X\307\346\253\351\275&J\345EF\363\372\003B9\336z\023c\245\361\210})""\rB[\252\\\270\214\312\301n\345\264 \337:\002\021\257}\027\306h\177\035u\242\224\2463\303y\216+\204\247\322\213IoE\005\302)\223\226p\002\317\035i\317y\363\\N:u!\241\254\253\013\355\264\327~B\001\200\"%&\224\207\364\264\316\225\310B\210Ha\250r\256L\213\361\"p\216\344\007O\026\212\343\347u\t\356A\370r\372\264\262\310\340\324P\223\340.\235v\333\375\356\030Nu\3420\0248\316]\210K\036G\210\243(3\037\255Av\220\004}4\244\326\214\021H\302r\021\242\025.r\244BJ\367x\342\353\217\360G\177\034\337\256\236\0068\2074\203\3011\020\355\361=\230A\006R\027\224>Vzd\352\374\207\316A\332\322\225>9\334\211\356nsE\373\301\325\256\240\227\203\225\025\237\252\324O\332\325\010\327vJ\314\027\026\352\266ze\016\2521Ny\277\311\375SXCY\260AO\035\007\350a+ \016\225\274^\351\334\225f%L\216\216\250\031:V\305~\025\323\r\373zs>\334\352\255\\\336f\027\215!\360B\232\210\016\317\0077\347\020\342\203\333\337\003\021%\200\216\272?\241\260 \000\0228\220x,\271g\233\207F\245T\323\\\330\217\253\333,\254\302YTI\241\307\007\313\376\241\204\315\277\005x\013\023J\224[\275\324\224TD\177*\005\272\316\333\352Q\027\271y\311\302\245\247\027\343\360c \347\342\315\037{\034Pu\251\275\363\023a\024\340\265\031t\276T\361\377\263\233\266zt\210\022?\367\206\207\226\270\027kc,%u\316\t\241w\275C\320\240|\036\313\024\353\032\251\312\363\246\324\023y\354\322.:u\371\211%\036\301\212\216>\215\230L\035\264\355\000^\255\331\275e}\302\3019?\372\177f\360\007\356\257L\016\220\371\251\013@FG\021\240\302\021\355\263\245\216\376[\364\001JOC\200\017p\036?\237{\350\214\234\214<\321\004x\205z\022x\273\271w{K?m\220\242bEU\313u\"\252\022\r\213\363\340\262\345\205\340\245\356\"\2748V:\014\027\367\n\267\304\222\026\026y6+\337'l\270\322xq\227>\236\027\371\206\225E\306\355\322\n\332\206u\230t\367g\275k\263k\177\376\356\311\371\227_\205\337\235\331\316\275\331\275\027\263\027/\317?\037\314\006\177\375\317\340\374\363/\272\277\377]\353}\362\2077\203\363\217\331\233\217h\274\366\257\177\236>=\373\350|\355\267gO\316\327~w&\316\327>=\371\343\351\003,]\371""\345\351\2157_\274Y\247\225\301\371\225\337\267#:\365\263/O\335\331zM\366\351\311\336\351\255S\021\317|\366\233\300\360]\343gg\277\006\351|\366\253\263\273a\366v.\366\027'\257\027\345,\t~\273\366\363\023s\366\344L\274\375\370\263\223''\351\351\327\263\2537\377}\345\273\273\264\373\342\315\237f7\036\315\036\005_\254]\235]\335\235\355b\372r\366\362\325\354\325AL\034-\262B\217\304\375V\215sy\244<\247\215\322\375\017\310\245\003\254"; + PyObject *data = __Pyx_DecompressString(cstring, 2247, 1); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #else /* compression: none (5946 bytes) */ -const char* const bytes = ")Column labels must be stringsNon unique column names detected in the dataframe!NoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Unknown data format to insertUnknown pywriter variable formatVersion not supported .?add_notealignment for variable and it must be str (not starting with numbers!)character missing_ranges value given for non character variable %scolumn_labels must be either list or dict!compress and row_compress cannot be both Truedataframe must be pandas or polars dataframedictionaries in missing_ranges must have the keys hi and lo does not exist!file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly. in variable instead' is of type length of column labels must be the same as number of columnsmeasure for variable missing_ranges: hi and lo values must be both the same for string typemissing_ranges: hi and lo values must be both either of numeric or string typemissing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowedmissing_ranges: max 1 range value per variable allowedmissing_ranges: max 3 discrete numeric values per variable allowedmissing_ranges: max 3 string values per variable allowedmissing_ranges: string values length must not be larger than 8missing_ranges: values in dictionary must be listmissing_ranges: values must be both either of numeric or string typemissing_user_values not allowed for character variable %smissing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s insteadmissing_user_values: values in dictionary must be list must be boolean or be 1 or 0 must be dict, got must be either nominal, ordinal, scale or unknown got must be either right, center, left or unknown got must be int must be numeric must be string must match the type of the column i""n dataframe and be of type date, datetime or timenote should be either str or list, got numeric missing_ranges value given for non numeric variable %s' (ordinal path must be either str or bytespyreadstat._readstat_parserpyreadstat/_readstat_writer.pyxpyreadstat.datetimepyreadstat.narwhals.stable.v2pyreadstat.numpypyreadstat.ospyreadstat.syspyreadstat.warnings' starts with an illegal (non-alphabetic) character: 'the destination folder unknown file formatutf-8variable name 'variable name '%s' contains a space, which is not allowedvariable names must be non-empty strings, not starting with numbersvariable_value_labels: type of Label variable_value_labels: type of Value variable_value_labels: value for key wrong writer formatBooleanCategoricalDateDatetimeDecimalEnumFloat32Float64Int128Int16Int32Int64Int8ObjectPyreadstatError__Pyx_PyDict_NextRefReadstatErrorStringTimeUInt128UInt16UInt32UInt64UInt8_asyncio.coroutinescastcatcenter__class_getitem__cline_in_tracebackclonecolumn_labelscolumnscombinecompressdatedatetimedatetime64daysdfdirnamedrop_nullsdst_pathdtadtypeeager_onlyencodeexpanduserfile_format_versionfile_labelfilterfrom_nativefsdecodefsencode__func__getget_categoriesget_native_namespacegetfilesystemencodinghiimplementation_is_coroutineis_inis_pandasis_polarsisalphaisdirisnaitemsiter_columnsiter_rowskeysleftlo__main__minmissing_rangesmissing_user_values__module__msname__name__narwhals.stable.v2nominalnotenpnsntnthnull_countnumpynwordinalospathpopporpyreadstat._readstat_writer__pyx_capi____qualname___readstat_parserreplacerightroundrow_compressrow_compressionsavscale__set_name__setdefaultstablesurrogateescapesystable_name__test__thentimetime_unittimestamptimezonetotal_secondstzinfounknownupperusutcv2valuesvariable_alignmentvariable_display_widthvariable_formatvariable_measurevariable_value_labelsversionwarnwarningswhenwith_columnswriter_entry_pointwriter_file_formatwriter_formatxxportzipPyObject *(PyObject *)\000PyObject *(PyObject *, PyObject *, PyObject *, int)""\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int)\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)\000\000Py_ssize_t (void const *, size_t, void *)\000char *(__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)\000double (__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *)\000int (PyObject *)\000int (PyObject *, PyObject *)\000int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)\000int (PyObject *, PyObject *, int)\000int (int)\000void (int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *)\000filepath_to_bytes\000get_narwhals_column_types\000vectorized_convert_datetime_to_number\000vectorized_convert_date_to_number\000vectorized_convert_time_to_number\000write_bytes\000get_datetimelike_format_for_readstat\000convert_datetimelike_to_number\000open_file\000check_series_all_same_types\000run_write\000get_narwhals_str_series_max_length\000close_file\000initial_checksPyObject *\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000readstat_to_numpy_types\000sas_all_formats\000sas_date_formats\000sas_datetime_formats\000sas_origin\000sas_time_formats\000spss_all_formats\000spss_date_formats\000spss_datetime_formats\000spss_origin\000spss_time_formats\000stata_all_formats\000stata_date_formats\000stata_datetime_formats\000stata_origin\000stata_time_formats\320\000%\320%=\270Q\330\027\030\330\027\030\330\0272\3202B\320BV\320VW\330\0201\3201K\3101\330\020\021\330\020\021\330\020\021\330\020\021\360\010\000\005$\2401\330\004 \240\001\360\010\000\005\010\200~\220S\230\001\330""\010\035\230Q\330\010\036\230a\330\010\013\2109\220D\230\001\330\014\022\220/\240\021\240!\330\010\013\2101\330\014\"\240!\330\010\013\2101\330\014\036\230a\330\t\027\220s\230!\330\010\035\230Q\330\010\013\2108\2203\220a\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220T\230\024\230Q\330\014\"\240!\330\r\025\220T\230\023\230A\330\014\"\240!\340\014\022\220/\240\021\240!\330\010\017\210q\330\t\027\220s\230!\330\010\035\230Q\330\010\036\230a\330\t\027\220s\230!\330\010\035\230Q\340\010\016\210o\230Q\230a\340\004\r\210Q\210d\220*\320\0340\260\014\270A\330\010\035\230V\240<\320/F\320FV\320VW\330\010\034\320\0344\3204F\320FW\320WXvoid (readstat_error_t)\000check_exit_status"; + #else /* compression: none (6138 bytes) */ +const char* const bytes = "Column labels must be stringsCould not open file 'Non unique column names detected in the dataframe!NoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.). The file may be locked by another process or you may not have write permission.Unknown data format to insertUnknown pywriter variable formatVersion not supported) .?add_notealignment for variable and it must be str (not starting with numbers!)character missing_ranges value given for non character variable %scolumn_labels must be either list or dict!compress and row_compress cannot be both Truedataframe must be pandas or polars dataframedictionaries in missing_ranges must have the keys hi and lo does not exist! (errno file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly.' for writing: in variable instead' is of type length of column labels must be the same as number of columnsmeasure for variable missing_ranges: hi and lo values must be both the same for string typemissing_ranges: hi and lo values must be both either of numeric or string typemissing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowedmissing_ranges: max 1 range value per variable allowedmissing_ranges: max 3 discrete numeric values per variable allowedmissing_ranges: max 3 string values per variable allowedmissing_ranges: string values length must not be larger than 8missing_ranges: values in dictionary must be listmissing_ranges: values must be both either of numeric or string typemissing_user_values not allowed for character variable %smissing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s insteadmissing_user_values: values in dictionary must be list must be boolean or be 1 or 0 must be dict, got must be either nominal, ordinal, scale or unknown got mus""t be either right, center, left or unknown got must be int must be numeric must be string must match the type of the column in dataframe and be of type date, datetime or timenote should be either str or list, got numeric missing_ranges value given for non numeric variable %s' (ordinal path must be either str or bytespyreadstat._readstat_parserpyreadstat/_readstat_writer.pyxpyreadstat.datetimepyreadstat.narwhals.stable.v2pyreadstat.numpypyreadstat.ospyreadstat.syspyreadstat.warnings' starts with an illegal (neither alphabetic nor an underscore) character: 'the destination folder unknown file formatutf-8variable name 'variable name '%s' contains a space, which is not allowedvariable names must be non-empty strings, not starting with numbersvariable_value_labels: type of Label variable_value_labels: type of Value variable_value_labels: value for key wrong writer format_BooleanCategoricalDateDatetimeDecimalEnumFloat32Float64Int128Int16Int32Int64Int8ObjectPyreadstatError__Pyx_PyDict_NextRefReadstatErrorStringTimeUInt128UInt16UInt32UInt64UInt8asyncio.coroutinescastcatcenter__class_getitem__cline_in_tracebackclonecolumn_labelscolumnscombinecompressddatedatetimedatetime64daysdfdirnamedrop_nullsdst_pathdtadtypeeager_onlyencodeexpanduserfile_format_versionfile_labelfilterfrom_nativefsdecodefsencode__func__getget_categoriesget_native_namespacegetfilesystemencodinghiimplementation_is_coroutineis_inis_pandasis_polarsisalphaisdirisnaitemsiter_columnsiter_rowskeysleftlo__main__minmissing_rangesmissing_user_values__module__msname__name__narwhals.stable.v2nominalnotenpnsntnthnull_countnumpynwordinalospathpopporpyreadstat._readstat_writer__pyx_capi____qualname___readstat_parserreplacerightroundrow_compressrow_compressionsavscale__set_name__setdefaultstablestrerrorsurrogateescapesystable_name__test__thentimetime_unittimestamptimezonetotal_secondstzinfounknownupperusutcv2valuesvariable_alignmentvariable_display_widthvariable_formatvariable_informatvariable_measurevariable_value_labels""versionwarnwarningswhenwith_columnswriter_entry_pointwriter_file_formatwriter_formatxxportzipPyObject *(PyObject *)\000PyObject *(PyObject *, PyObject *, PyObject *, int)\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int)\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)\000\000Py_ssize_t (void const *, size_t, void *)\000char *(__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)\000double (__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *)\000int (PyObject *)\000int (PyObject *, PyObject *)\000int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)\000int (PyObject *, PyObject *, int)\000int (int)\000void (int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *)\000filepath_to_bytes\000get_narwhals_column_types\000vectorized_convert_datetime_to_number\000vectorized_convert_date_to_number\000vectorized_convert_time_to_number\000write_bytes\000get_datetimelike_format_for_readstat\000convert_datetimelike_to_number\000open_file\000check_series_all_same_types\000run_write\000get_narwhals_str_series_max_length\000close_file\000initial_checksPyObject *\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000readstat_to_numpy_types\000sas_all_formats\000sas_date_formats\000sas_datetime_formats\000sas_origin\000sas_time_formats\000spss_all_formats\000spss_date_formats\000spss_datetime_formats\000spss_origin\000spss_time_formats\000stata_all_formats\000stata_date_formats\000stata_datetime_formats\000stata_origin\000stata_time_formats\320\000%\320%=\270Q\330\027\030\330\027""\030\330\0272\3202B\320BV\320VW\330\0201\3201K\3101\330\020\021\330\020\021\330\020\021\330\020\021\330\020\021\360\010\000\005$\2401\330\004 \240\001\360\010\000\005\010\200~\220S\230\001\330\010\035\230Q\330\010\036\230a\330\010\013\2109\220D\230\001\330\014\022\220/\240\021\240!\330\010\013\2101\330\014\"\240!\330\010\013\2101\330\014\036\230a\330\t\027\220s\230!\330\010\035\230Q\330\010\013\2108\2203\220a\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220T\230\024\230Q\330\014\"\240!\330\r\025\220T\230\023\230A\330\014\"\240!\340\014\022\220/\240\021\240!\330\010\017\210q\330\t\027\220s\230!\330\010\035\230Q\330\010\036\230a\330\t\027\220s\230!\330\010\035\230Q\340\010\016\210o\230Q\230a\340\004\r\210Q\210d\220*\320\0340\260\014\270A\330\010\035\230V\240<\320/F\320FV\320VW\330\010\034\320\0344\3204F\320FW\320Wj\320jkvoid (readstat_error_t)\000check_exit_status"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif PyObject **stringtab = __pyx_mstate->__pyx_string_tab; Py_ssize_t pos = 0; - for (int i = 0; i < 215; i++) { + for (int i = 0; i < 222; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); - if (likely(string) && i >= 70) PyUnicode_InternInPlace(&string); + if (likely(string) && i >= 74) PyUnicode_InternInPlace(&string); if (unlikely(!string)) { Py_XDECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) @@ -19531,7 +19748,7 @@ const char* const bytes = ")Column labels must be stringsNon unique column names stringtab[i] = string; pos += bytes_length; } - for (int i = 215; i < 219; i++) { + for (int i = 222; i < 226; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -19542,14 +19759,14 @@ const char* const bytes = ")Column labels must be stringsNon unique column names } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 219; i++) { + for (Py_ssize_t i = 0; i < 226; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 215; + PyObject **table = stringtab + 222; for (Py_ssize_t i=0; i<4; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #if PY_VERSION_HEX < 0x030E0000 @@ -19577,15 +19794,15 @@ const char* const bytes = ")Column labels must be stringsNon unique column names } { PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 3; - int8_t const cint_constants_1[] = {0,1,65,97}; + int8_t const cint_constants_1[] = {0,1,9,65,97}; int16_t const cint_constants_2[] = {1970}; - for (int i = 0; i < 5; i++) { - numbertab[i] = PyLong_FromLong((i < 4 ? cint_constants_1[i - 0] : cint_constants_2[i - 4])); + for (int i = 0; i < 6; i++) { + numbertab[i] = PyLong_FromLong((i < 5 ? cint_constants_1[i - 0] : cint_constants_2[i - 5])); if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) } } { - PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 8; + PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 9; const char* c_constant = "-8000000000000"; for (int i = 0; i < 1; i++) { char *end_pos; @@ -19597,7 +19814,7 @@ const char* const bytes = ")Column labels must be stringsNon unique column names #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_number_tab; - for (Py_ssize_t i=0; i<9; ++i) { + for (Py_ssize_t i=0; i<10; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #if PY_VERSION_HEX < 0x030E0000 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) @@ -19641,8 +19858,8 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {17, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_writer_format, __pyx_mstate->__pyx_n_u_file_label, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_column_labels, __pyx_mstate->__pyx_n_u_compress, __pyx_mstate->__pyx_n_u_row_compress, __pyx_mstate->__pyx_n_u_note, __pyx_mstate->__pyx_n_u_variable_value_labels, __pyx_mstate->__pyx_n_u_missing_ranges, __pyx_mstate->__pyx_n_u_variable_display_width, __pyx_mstate->__pyx_n_u_variable_measure, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_format, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_row_compression, __pyx_mstate->__pyx_n_u_writer_file_format}; + const __Pyx_PyCode_New_function_description descr = {18, 0, 0, 21, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 999}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_writer_format, __pyx_mstate->__pyx_n_u_file_label, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_column_labels, __pyx_mstate->__pyx_n_u_compress, __pyx_mstate->__pyx_n_u_row_compress, __pyx_mstate->__pyx_n_u_note, __pyx_mstate->__pyx_n_u_variable_value_labels, __pyx_mstate->__pyx_n_u_missing_ranges, __pyx_mstate->__pyx_n_u_variable_display_width, __pyx_mstate->__pyx_n_u_variable_measure, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_format, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_variable_informat, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_row_compression, __pyx_mstate->__pyx_n_u_writer_file_format}; __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_writer_pyx, __pyx_mstate->__pyx_n_u_writer_entry_point, __pyx_mstate->__pyx_kp_b_iso88591_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } Py_DECREF(tuple_dedup_map); @@ -21646,6 +21863,99 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif } +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (unlikely(!(is_unsigned || value == 0 || value > 0) || + !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { + PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); + return NULL; + } + if (width <= 1) { + return PyUnicode_FromOrdinal((int) value); + } + return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); +} +static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(int)*3+2]; + char *dpos, *end = digits + sizeof(int)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + int remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (int) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (int) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (int) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { @@ -22813,7 +23123,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__4); + module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -25239,6 +25549,325 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) { } } +/* CIntFromPy */ +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyLong_As_PY_LONG_LONG(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (unlikely(!PyLong_Check(x))) { + PY_LONG_LONG val; + PyObject *tmp = __Pyx_PyNumber_Long(x); + if (!tmp) return (PY_LONG_LONG) -1; + val = __Pyx_PyLong_As_PY_LONG_LONG(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT)) { + return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT)) { + return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT)) { + return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (PY_LONG_LONG) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x)) + } else if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { + return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { + return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { + return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { + return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { + return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) { + return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(PY_LONG_LONG) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x)) + } else if ((sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x)) + } + } + { + PY_LONG_LONG val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (PY_LONG_LONG) -1; + assert(PyLong_CheckExact(v)); + } + { + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { + Py_DECREF(v); + return (PY_LONG_LONG) -1; + } + is_negative = result == 1; + } + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (PY_LONG_LONG) -1; + } else { + stepval = v; + } + v = NULL; + val = (PY_LONG_LONG) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((PY_LONG_LONG) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((PY_LONG_LONG) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((PY_LONG_LONG) 1) << (sizeof(PY_LONG_LONG) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) + return (PY_LONG_LONG) -1; + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to PY_LONG_LONG"); + return (PY_LONG_LONG) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PY_LONG_LONG(PY_LONG_LONG value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(PY_LONG_LONG) < sizeof(long)) { + return PyLong_FromLong((long) value); + } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#if !CYTHON_COMPILING_IN_PYPY + } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(PY_LONG_LONG) <= sizeof(long)) { + return PyLong_FromLong((long) value); + } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); + } + } + { + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 + if (is_unsigned) { + return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); + } else { + return PyLong_FromNativeBytes(bytes, sizeof(value), -1); + } +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + int one = 1; int little = (int)*(unsigned char *)&one; + return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG), + little, !is_unsigned); +#else + int one = 1; int little = (int)*(unsigned char *)&one; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); + } + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + /* CIntFromPy */ static CYTHON_INLINE readstat_type_t __Pyx_PyLong_As_readstat_type_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/pyreadstat/_readstat_writer.pxd b/pyreadstat/_readstat_writer.pxd index 4cda8ef..489d7a7 100644 --- a/pyreadstat/_readstat_writer.pxd +++ b/pyreadstat/_readstat_writer.pxd @@ -94,4 +94,5 @@ cdef void initial_checks(bint is_pandas, bint is_polars, dict variable_value_lab cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, int file_format_version, object note, str table_name, dict variable_value_labels, dict missing_ranges, dict missing_user_values, dict variable_alignment, - dict variable_display_width, dict variable_measure, dict variable_format, bint row_compression) except * + dict variable_display_width, dict variable_measure, dict variable_format, dict variable_informat, + bint row_compression) except * diff --git a/pyreadstat/_readstat_writer.pyx b/pyreadstat/_readstat_writer.pyx index 35d2a6f..ba1e62e 100644 --- a/pyreadstat/_readstat_writer.pyx +++ b/pyreadstat/_readstat_writer.pyx @@ -28,6 +28,7 @@ import numpy as np import narwhals.stable.v2 as nw from readstat_api cimport * +from libc.errno cimport errno from _readstat_parser import ReadstatError, PyreadstatError from _readstat_parser cimport check_exit_status @@ -64,19 +65,19 @@ cdef object vectorized_convert_datetime_to_number(object df, dst_file_format fil transforms datetime64 columns in the dataframe to floats """ cdef dict convfacs - cdef double offset_secs - cdef double mulfac = 1.0 + cdef long long offset_secs + cdef int mulfac = 1 cdef int col_indx cdef list col_indxs - cdef double convfac + cdef int convfac if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: - offset_secs = spss_offset_secs + offset_secs = int(spss_offset_secs) else: - offset_secs = sas_offset_secs + offset_secs = int(sas_offset_secs) if file_format == FILE_FORMAT_DTA: # stata stores in milliseconds - mulfac = 1000.0 + mulfac = 1000 convfacs = {'ns': 1e9, 'us': 1e6, 'ms': 1e3} col_indxs = list() @@ -87,8 +88,10 @@ cdef object vectorized_convert_datetime_to_number(object df, dst_file_format fil df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) for col_indx in col_indxs: convfac = convfacs[pywriter_timeunits[col_indx]] - df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) + whole = nw.nth(col_indx) // convfac + offset_secs + frac = nw.nth(col_indx) % convfac + df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then( + (whole.cast(nw.Float64) * mulfac + frac.cast(nw.Float64) / convfac * mulfac))) return df @@ -138,7 +141,7 @@ cdef object vectorized_convert_time_to_number(object df, dst_file_format file_fo df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) for col_indx in col_indxs: df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) - df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) + df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round(9) * mulfac) return df cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: @@ -146,7 +149,8 @@ cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter converts a datime like python/pandas object to a float """ - cdef double offset_days, tstamp + cdef double offset_days + cdef double tstamp = 0 if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: offset_days = spss_offset_days @@ -574,18 +578,6 @@ cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx) noexcept: else: return write(fd, data, _len) -cdef void _check_exit_status(readstat_error_t retcode) except *: - """ - transforms a readstat exit status to a python error if status is not READSTAT OK - """ - - cdef char * err_readstat - cdef str err_message - if retcode != READSTAT_OK: - err_readstat = readstat_error_message(retcode) - err_message = err_readstat - raise ReadstatError(err_message) - cdef int open_file(bytes filename_bytes): cdef int fd @@ -607,6 +599,8 @@ cdef int open_file(bytes filename_bytes): return fd cdef int close_file(int fd): + if fd == -1: + return -1 if os.name == "nt": return _close(fd) else: @@ -653,8 +647,8 @@ cdef void initial_checks(bint is_pandas, bint is_polars, dict variable_value_lab raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) if len(variable_name) == 0: raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - if not variable_name[0].isalpha(): - raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + if not (variable_name[0].isalpha() or variable_name[0] == "_"): + raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) if " " in variable_name: raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) @@ -685,7 +679,8 @@ cdef bytes filepath_to_bytes(object filename_path): cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, int file_format_version, object note, str table_name, dict variable_value_labels, dict missing_ranges, dict missing_user_values, dict variable_alignment, - dict variable_display_width, dict variable_measure, dict variable_format, bint row_compression) except *: + dict variable_display_width, dict variable_measure, dict variable_format, + dict variable_informat, bint row_compression) except *: """ main entry point for writing all formats. Some parameters are specific for certain file type and are even incompatible between them. This function relies on the caller to select the right @@ -769,6 +764,11 @@ cdef int run_write(df, object filename_path, dst_file_format file_format, str fi cdef int fd = open_file(filename_bytes) + if fd == -1: + raise PyreadstatError( + "Could not open file '%s' for writing: %s (errno %d). " + "The file may be locked by another process or you may not have write permission." + % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) writer = readstat_writer_init() try: @@ -833,6 +833,10 @@ cdef int run_write(df, object filename_path, dst_file_format file_format, str fi if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): curformat = get_datetimelike_format_for_readstat(file_format, curtype) readstat_variable_set_format(variable, curformat) + if variable_informat: + tempformat = variable_informat.get(variable_name) + if tempformat: + readstat_variable_set_informat(variable, tempformat.encode("utf-8")) # prepare string_ref # for STRING_REF we have to add to a dict here before start writing if curtype == PYWRITER_DTA_STR_REF: @@ -1001,6 +1005,7 @@ def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", dict missing_user_values=None, dict variable_format=None, dict variable_alignment = None, + dict variable_informat=None, ): @@ -1045,4 +1050,4 @@ def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", run_write(df, dst_path, writer_file_format, file_label, column_labels, file_format_version, note, table_name, variable_value_labels, missing_ranges, missing_user_values, - variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) + variable_alignment, variable_display_width, variable_measure, variable_format, variable_informat, row_compression) diff --git a/pyreadstat/pyclasses.py b/pyreadstat/pyclasses.py index 11121db..faae82e 100644 --- a/pyreadstat/pyclasses.py +++ b/pyreadstat/pyclasses.py @@ -48,8 +48,8 @@ class metadata_container: """ column_names: list[str] = field(default_factory=list) - column_labels: list[str] = field(default_factory=list) - column_names_to_labels: dict[str, str] = field(default_factory=dict) + column_labels: list[str | None] = field(default_factory=list) + column_names_to_labels: dict[str, str | None] = field(default_factory=dict) file_encoding: str | None = None file_label: str | None = None number_columns: int | None = None @@ -58,7 +58,8 @@ class metadata_container: value_labels: dict[str, dict[float | int, str]] = field(default_factory=dict) variable_to_label: dict[str, str] = field(default_factory=dict) notes: list[str] = field(default_factory=list) - original_variable_types: dict[str, str] = field(default_factory=dict) + original_variable_types: dict[str, str | None] = field(default_factory=dict) + original_variable_informats: dict[str, str | None] = field(default_factory=dict) readstat_variable_types: dict[str, str] = field(default_factory=dict) table_name: str | None = None missing_ranges: dict[str, list[int | float | str | MissingRange]] = field(default_factory=dict) @@ -66,7 +67,7 @@ class metadata_container: variable_storage_width: dict[str, int] = field(default_factory=dict) variable_display_width: dict[str, int] = field(default_factory=dict) variable_alignment: dict[str, str] = field(default_factory=dict) - variable_measure: dict[str, Literal["nominal", "ordinal", "scale", "unknown"]] = field(default_factory=dict) + variable_measure: dict[str, Literal["nominal", "ordinal", "scale", "unknown", "undetermined"]] = field(default_factory=dict) creation_time: datetime | None = None modification_time: datetime | None = None mr_sets: dict[str, MRSet] = field(default_factory=dict) diff --git a/pyreadstat/pyreadstat.py b/pyreadstat/pyreadstat.py index e777c30..97d5452 100644 --- a/pyreadstat/pyreadstat.py +++ b/pyreadstat/pyreadstat.py @@ -1039,8 +1039,15 @@ def read_file_in_chunks( if "num_processes" in kwargs: _ = kwargs.pop("num_processes") + + output_format = None + if "output_format" in kwargs: + output_format = kwargs["output_format"] - _, meta = read_function(file_path, metadataonly=True) + if output_format: + _, meta = read_function(file_path, metadataonly=True, output_format=output_format) + else: + _, meta = read_function(file_path, metadataonly=True) numrows = meta.number_rows if numrows: if not limit: @@ -1205,7 +1212,7 @@ def write_sav( df: "DataFrame", dst_path: FilePathLike, file_label: str = "", - column_labels: list[str] | dict[str, str] | None = None, + column_labels: list[str | None] | dict[str, str | None] | None = None, compress: bool = False, row_compress: bool = False, note: str | list[str] | None = None, @@ -1291,7 +1298,7 @@ def write_dta( df: "DataFrame", dst_path: FilePathLike, file_label: str = "", - column_labels: list[str] | dict[str, str] | None = None, + column_labels: list[str | None] | dict[str, str | None] | None = None, version: int = 15, variable_value_labels: dict[str, dict[int | float, str]] | None = None, missing_user_values: dict[str, list[str]] | None = None, @@ -1347,10 +1354,11 @@ def write_xport( df: "DataFrame", dst_path: FilePathLike, file_label: str = "", - column_labels: list[str] | dict[str, str] | None = None, + column_labels: list[str | None] | dict[str, str | None] | None = None, table_name: str | None = None, file_format_version: Literal[5, 8] = 8, variable_format: dict[str, str] | None = None, + variable_informat: dict[str, str] | None = None, ) -> None: """ Writes a dataframe to a SAS Xport (xpt) file. @@ -1379,6 +1387,9 @@ def write_xport( sets the format of a variable. Must be a dictionary with keys being the variable names and values being strings defining the format. See README, setting variable formats section, for more information. + variable_informat: dict, optional + sets the informat of a variable. Must be a dictionary with keys being the variable names and + values being strings defining the format. """ writer_format = "xport" @@ -1391,6 +1402,7 @@ def write_xport( version=file_format_version, table_name=table_name, variable_format=variable_format, + variable_informat=variable_informat, ) @@ -1398,7 +1410,7 @@ def write_por( df: "DataFrame", dst_path: FilePathLike, file_label: str = "", - column_labels: list[str] | dict[str, str] | None = None, + column_labels: list[str | None] | dict[str, str | None] | None = None, variable_format: dict[str, str] | None = None, ) -> None: """ diff --git a/pyreadstat/readstat_api.pxd b/pyreadstat/readstat_api.pxd index af41f4f..d724266 100644 --- a/pyreadstat/readstat_api.pxd +++ b/pyreadstat/readstat_api.pxd @@ -184,6 +184,7 @@ cdef extern from "readstat.h": cdef char *readstat_variable_get_name(readstat_variable_t *variable) cdef char *readstat_variable_get_label(readstat_variable_t *variable) cdef char *readstat_variable_get_format(readstat_variable_t *variable) + cdef char *readstat_variable_get_informat(const readstat_variable_t *variable); cdef readstat_type_t readstat_variable_get_type(const readstat_variable_t *variable); cdef readstat_measure_t readstat_variable_get_measure(const readstat_variable_t *variable); cdef readstat_alignment_t readstat_variable_get_alignment(const readstat_variable_t *variable) @@ -246,6 +247,7 @@ cdef extern from "readstat.h": cdef void readstat_variable_set_label(readstat_variable_t *variable, const char *label) cdef void readstat_variable_set_format(readstat_variable_t *variable, const char *format); + cdef void readstat_variable_set_informat(readstat_variable_t *variable, const char *informat); cdef void readstat_variable_set_label_set(readstat_variable_t *variable, readstat_label_set_t *label_set); cdef void readstat_variable_set_measure(readstat_variable_t *variable, readstat_measure_t measure); cdef void readstat_variable_set_alignment(readstat_variable_t *variable, readstat_alignment_t alignment); diff --git a/setup.py b/setup.py index bc9434a..bc9ec8e 100644 --- a/setup.py +++ b/setup.py @@ -129,7 +129,7 @@ def is_conda(): setup( name='pyreadstat', - version='1.3.5', + version='1.3.6', description=short_description, author="Otto Fajardo", author_email="pleasecontactviagithub@notvalid.com", diff --git a/src/readstat.h b/src/readstat.h index c6ece53..1b33581 100644 --- a/src/readstat.h +++ b/src/readstat.h @@ -205,6 +205,7 @@ typedef struct readstat_variable_s { int index; char name[300]; char format[256]; + char informat[256]; char label[1024]; readstat_label_set_t *label_set; off_t offset; @@ -287,6 +288,7 @@ int readstat_variable_get_index_after_skipping(const readstat_variable_t *variab const char *readstat_variable_get_name(const readstat_variable_t *variable); const char *readstat_variable_get_label(const readstat_variable_t *variable); const char *readstat_variable_get_format(const readstat_variable_t *variable); +const char *readstat_variable_get_informat(const readstat_variable_t *variable); readstat_type_t readstat_variable_get_type(const readstat_variable_t *variable); readstat_type_class_t readstat_variable_get_type_class(const readstat_variable_t *variable); size_t readstat_variable_get_storage_width(const readstat_variable_t *variable); @@ -538,6 +540,7 @@ readstat_variable_t *readstat_add_variable(readstat_writer_t *writer, const char size_t storage_width); void readstat_variable_set_label(readstat_variable_t *variable, const char *label); void readstat_variable_set_format(readstat_variable_t *variable, const char *format); +void readstat_variable_set_informat(readstat_variable_t *variable, const char *informat); void readstat_variable_set_label_set(readstat_variable_t *variable, readstat_label_set_t *label_set); void readstat_variable_set_measure(readstat_variable_t *variable, readstat_measure_t measure); void readstat_variable_set_alignment(readstat_variable_t *variable, readstat_alignment_t alignment); diff --git a/src/readstat_variable.c b/src/readstat_variable.c index ecd71ab..37d5164 100644 --- a/src/readstat_variable.c +++ b/src/readstat_variable.c @@ -41,6 +41,13 @@ const char *readstat_variable_get_format(const readstat_variable_t *variable) { return NULL; } +const char *readstat_variable_get_informat(const readstat_variable_t *variable) { + if (variable->informat[0]) + return variable->informat; + + return NULL; +} + readstat_type_t readstat_variable_get_type(const readstat_variable_t *variable) { return variable->type; } diff --git a/src/readstat_writer.c b/src/readstat_writer.c index c1e9890..dfba46c 100644 --- a/src/readstat_writer.c +++ b/src/readstat_writer.c @@ -28,6 +28,7 @@ static int readstat_compare_string_refs(const void *elem1, const void *elem2) { readstat_string_ref_t *readstat_string_ref_init(const char *string) { size_t len = strlen(string) + 1; readstat_string_ref_t *ref = calloc(1, sizeof(readstat_string_ref_t) + len); + if (ref == NULL) return NULL; ref->first_o = -1; ref->first_v = -1; ref->len = len; @@ -140,6 +141,7 @@ static readstat_error_t readstat_begin_writing_data(readstat_writer_t *writer) { } writer->row_len = row_len; writer->row = malloc(writer->row_len); + if (writer->row == NULL) { retval = READSTAT_ERROR_MALLOC; goto cleanup; } if (writer->callbacks.begin_data) { retval = writer->callbacks.begin_data(writer); } @@ -436,6 +438,14 @@ void readstat_variable_set_format(readstat_variable_t *variable, const char *for } } +void readstat_variable_set_informat(readstat_variable_t *variable, const char *informat) { + if (informat) { + snprintf(variable->informat, sizeof(variable->informat), "%s", informat); + } else { + memset(variable->informat, '\0', sizeof(variable->informat)); + } +} + void readstat_variable_set_measure(readstat_variable_t *variable, readstat_measure_t measure) { variable->measure = measure; } diff --git a/src/sas/readstat_sas.h b/src/sas/readstat_sas.h index 5f4f286..5d58910 100644 --- a/src/sas/readstat_sas.h +++ b/src/sas/readstat_sas.h @@ -111,8 +111,9 @@ typedef enum sas_subheader_type_e { #define SAS_PAGE_TYPE_AMD 0x0400 #define SAS_PAGE_TYPE_MASK 0x0F00 -#define SAS_PAGE_TYPE_META2 0x4000 -#define SAS_PAGE_TYPE_COMP 0x9000 +#define SAS_PAGE_TYPE_DELETED_ROWS 0x0080 +#define SAS_PAGE_TYPE_META2 0x4000 +#define SAS_PAGE_TYPE_COMP 0x9000 #define SAS_SUBHEADER_POINTER_SIZE_32BIT 12 #define SAS_SUBHEADER_POINTER_SIZE_64BIT 24 @@ -120,9 +121,10 @@ typedef enum sas_subheader_type_e { #define SAS_PAGE_HEADER_SIZE_32BIT 24 #define SAS_PAGE_HEADER_SIZE_64BIT 40 -#define SAS_COMPRESSION_NONE 0x00 -#define SAS_COMPRESSION_TRUNC 0x01 -#define SAS_COMPRESSION_ROW 0x04 +#define SAS_COMPRESSION_NONE 0x00 +#define SAS_COMPRESSION_TRUNC 0x01 +#define SAS_COMPRESSION_ROW 0x04 +#define SAS_COMPRESSION_DELETED_ROW 0x05 #define SAS_COMPRESSION_SIGNATURE_RLE "SASYZCRL" #define SAS_COMPRESSION_SIGNATURE_RDC "SASYZCR2" diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index 5fc8444..8e0cb95 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "readstat_sas.h" #include "readstat_sas_rle.h" #include "../readstat_iconv.h" @@ -45,9 +46,12 @@ typedef struct sas7bdat_ctx_s { uint32_t row_length; uint32_t page_row_count; + uint32_t total_row_count; uint32_t parsed_row_count; + uint32_t parsed_deleted_row_count; uint32_t column_count; uint32_t row_limit; + uint32_t deleted_row_count; uint32_t row_offset; uint64_t header_size; @@ -232,7 +236,7 @@ static readstat_error_t sas7bdat_parse_column_size_subheader(const char *subhead static readstat_error_t sas7bdat_parse_row_size_subheader(const char *subheader, size_t len, sas7bdat_ctx_t *ctx) { readstat_error_t retval = READSTAT_OK; uint64_t total_row_count; - uint64_t row_length, page_row_count; + uint64_t row_length, deleted_row_count, page_row_count; if (len < (ctx->u64 ? 250: 190)) { retval = READSTAT_ERROR_PARSE; @@ -242,13 +246,22 @@ static readstat_error_t sas7bdat_parse_row_size_subheader(const char *subheader, if (ctx->u64) { row_length = sas_read8(&subheader[40], ctx->bswap); total_row_count = sas_read8(&subheader[48], ctx->bswap); + deleted_row_count = sas_read8(&subheader[56], ctx->bswap); page_row_count = sas_read8(&subheader[120], ctx->bswap); } else { row_length = sas_read4(&subheader[20], ctx->bswap); total_row_count = sas_read4(&subheader[24], ctx->bswap); + deleted_row_count = sas_read4(&subheader[28], ctx->bswap); page_row_count = sas_read4(&subheader[60], ctx->bswap); } + if (deleted_row_count > total_row_count) { + retval = READSTAT_ERROR_PARSE; + goto cleanup; + } + ctx->total_row_count = total_row_count; + ctx->deleted_row_count = deleted_row_count; + 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), @@ -275,12 +288,13 @@ static readstat_error_t sas7bdat_parse_row_size_subheader(const char *subheader, } ctx->page_row_count = page_row_count; - uint64_t total_row_count_after_skipping = total_row_count; - if (total_row_count > ctx->row_offset) { + uint64_t live_row_count = total_row_count - deleted_row_count; + uint64_t total_row_count_after_skipping = live_row_count; + if (live_row_count > ctx->row_offset) { total_row_count_after_skipping -= ctx->row_offset; } else { total_row_count_after_skipping = 0; - ctx->row_offset = total_row_count; + ctx->row_offset = live_row_count; } if (ctx->row_limit == 0 || total_row_count_after_skipping < ctx->row_limit) ctx->row_limit = total_row_count_after_skipping; @@ -393,6 +407,14 @@ static readstat_error_t sas7bdat_parse_column_format_subheader(const char *subhe return retval; } +static readstat_error_t sas7bdat_register_deleted_row(sas7bdat_ctx_t *ctx) { + if (ctx->parsed_deleted_row_count >= ctx->deleted_row_count) { + return READSTAT_ERROR_PARSE; + } + ctx->parsed_deleted_row_count++; + return READSTAT_OK; +} + static readstat_error_t sas7bdat_handle_data_value(readstat_variable_t *variable, col_info_t *col_info, const char *col_data, sas7bdat_ctx_t *ctx) { readstat_error_t retval = READSTAT_OK; @@ -490,7 +512,15 @@ static readstat_error_t sas7bdat_parse_single_row(const char *data, sas7bdat_ctx return retval; } -static readstat_error_t sas7bdat_parse_rows(const char *data, size_t len, sas7bdat_ctx_t *ctx) { +static unsigned char sas7bdat_read_bitmap(const unsigned char *bitmap, int index) { + unsigned char current_byte = bitmap[index / CHAR_BIT]; + unsigned char mask = 1 << (CHAR_BIT - 1 - index % CHAR_BIT); + + return current_byte & mask; +} + +static readstat_error_t sas7bdat_parse_rows(const char *data, size_t len, + const unsigned char *deleted_bitmap, sas7bdat_ctx_t *ctx) { readstat_error_t retval = READSTAT_OK; int i; size_t row_offset=0; @@ -499,8 +529,13 @@ static readstat_error_t sas7bdat_parse_rows(const char *data, size_t len, sas7bd retval = READSTAT_ERROR_ROW_WIDTH_MISMATCH; goto cleanup; } - if ((retval = sas7bdat_parse_single_row(&data[row_offset], ctx)) != READSTAT_OK) + if (deleted_bitmap != NULL && sas7bdat_read_bitmap(deleted_bitmap, i)) { + if ((retval = sas7bdat_register_deleted_row(ctx)) != READSTAT_OK) { + goto cleanup; + } + } else if ((retval = sas7bdat_parse_single_row(&data[row_offset], ctx)) != READSTAT_OK) { goto cleanup; + } row_offset += ctx->row_length; } @@ -513,6 +548,7 @@ static readstat_error_t sas7bdat_parse_subheader_rdc(const char *subheader, size readstat_error_t retval = READSTAT_OK; const unsigned char *input = (const unsigned char *)subheader; char *buffer = malloc(ctx->row_length); + if (buffer == NULL) return READSTAT_ERROR_MALLOC; char *output = buffer; while (input + 2 <= (const unsigned char *)subheader + len) { int i; @@ -708,6 +744,9 @@ static readstat_variable_t *sas7bdat_init_variable(sas7bdat_ctx_t *ctx, int i, len += snprintf(variable->format + len, sizeof(variable->format) - len, ".%d", ctx->col_info[i].format_digits); } + if (len) { // TODO where is the informat saved? + readstat_variable_set_informat(variable, variable->format); + } if ((retval = sas7bdat_copy_text_ref(variable->label, sizeof(variable->label), ctx->col_info[i].label_ref, ctx)) != READSTAT_OK) { goto cleanup; @@ -931,7 +970,7 @@ static readstat_error_t sas7bdat_parse_page_pass1(const char *page, size_t page_ goto cleanup; } } - } else if (shp_info.compression == SAS_COMPRESSION_ROW) { + } else if (shp_info.compression == SAS_COMPRESSION_ROW || shp_info.compression == SAS_COMPRESSION_DELETED_ROW) { /* void */ } else { retval = READSTAT_ERROR_UNSUPPORTED_COMPRESSION; @@ -947,6 +986,25 @@ static readstat_error_t sas7bdat_parse_page_pass1(const char *page, size_t page_ return retval; } +static readstat_error_t sas7bdat_parse_deleted_row_bitmap(const char *page, const char *data, + size_t page_size, const unsigned char **deleted_row_bitmap, sas7bdat_ctx_t *ctx) { + uint64_t page_unused_bytes; + if (ctx->u64) { + page_unused_bytes = sas_read8(&page[24], ctx->bswap); + } else { + page_unused_bytes = sas_read4(&page[12], ctx->bswap); + } + uint32_t row_count = ctx->page_row_count < ctx->total_row_count ? ctx->page_row_count : ctx->total_row_count; + uint64_t deleted_row_bitmap_offset = (uint64_t)row_count * ctx->row_length + page_unused_bytes; + uint32_t required_bytes = row_count / CHAR_BIT + (row_count % CHAR_BIT == 0 ? 0 : 1); + + if ((data - page) + deleted_row_bitmap_offset + required_bytes > page_size) { + return READSTAT_ERROR_PARSE; + } + *deleted_row_bitmap = (const unsigned char *)data + deleted_row_bitmap_offset; + return READSTAT_OK; +} + static readstat_error_t sas7bdat_parse_page_pass2(const char *page, size_t page_size, sas7bdat_ctx_t *ctx) { uint16_t page_type; @@ -1007,6 +1065,10 @@ static readstat_error_t sas7bdat_parse_page_pass2(const char *page, size_t page_ if ((retval = sas7bdat_parse_subheader_compressed(page + shp_info.offset, shp_info.len, ctx)) != READSTAT_OK) { goto cleanup; } + } else if (shp_info.compression == SAS_COMPRESSION_DELETED_ROW) { + if ((retval = sas7bdat_register_deleted_row(ctx)) != READSTAT_OK) { + goto cleanup; + } } else { retval = READSTAT_ERROR_UNSUPPORTED_COMPRESSION; goto cleanup; @@ -1036,7 +1098,14 @@ static readstat_error_t sas7bdat_parse_page_pass2(const char *page, size_t page_ goto cleanup; } if (ctx->handle.value) { - retval = sas7bdat_parse_rows(data, page + page_size - data, ctx); + const unsigned char *deleted_row_bitmap = NULL; + if (page_type & SAS_PAGE_TYPE_DELETED_ROWS) { + if ((retval = sas7bdat_parse_deleted_row_bitmap(page, data, page_size, + &deleted_row_bitmap, ctx)) != READSTAT_OK) { + goto cleanup; + } + } + retval = sas7bdat_parse_rows(data, page + page_size - data, deleted_row_bitmap, ctx); } } cleanup: @@ -1211,6 +1280,11 @@ readstat_error_t readstat_parse_sas7bdat(readstat_parser_t *parser, const char * sas7bdat_ctx_t *ctx = calloc(1, sizeof(sas7bdat_ctx_t)); sas_header_info_t *hinfo = calloc(1, sizeof(sas_header_info_t)); + if (ctx == NULL || hinfo == NULL) { + retval = READSTAT_ERROR_MALLOC; + goto cleanup; + } + ctx->handle = parser->handlers; ctx->input_encoding = parser->input_encoding; ctx->output_encoding = parser->output_encoding; diff --git a/src/sas/readstat_xport_read.c b/src/sas/readstat_xport_read.c index 6bd9ddb..84e83b5 100644 --- a/src/sas/readstat_xport_read.c +++ b/src/sas/readstat_xport_read.c @@ -281,6 +281,7 @@ 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 = malloc(4 * src_len + 1); + if (format == NULL) return READSTAT_ERROR_MALLOC; readstat_error_t retval = readstat_convert(format, 4 * src_len + 1, src, src_len, NULL); if (retval != READSTAT_OK) { @@ -431,6 +432,11 @@ static readstat_error_t xport_read_labels_v9(xport_ctx_t *ctx, int label_count) format, format_len, ctx->converter); if (retval != READSTAT_OK) goto cleanup; + + retval = readstat_convert(variable->informat, sizeof(variable->informat), + informat, informat_len, ctx->converter); + if (retval != READSTAT_OK) + goto cleanup; } retval = xport_skip_rest_of_record(ctx); @@ -487,7 +493,13 @@ static readstat_error_t xport_read_variables(xport_ctx_t *ctx) { retval = xport_construct_format(variable->format, sizeof(variable->format), namestr.nform, sizeof(namestr.nform), - variable->display_width, variable->decimals); + namestr.nfl, namestr.nfd); + if (retval != READSTAT_OK) + goto cleanup; + + retval = xport_construct_format(variable->informat, sizeof(variable->informat), + namestr.niform, sizeof(namestr.niform), + namestr.nifl, namestr.nifd); if (retval != READSTAT_OK) goto cleanup; diff --git a/src/sas/readstat_xport_write.c b/src/sas/readstat_xport_write.c index 2383360..72d7f39 100644 --- a/src/sas/readstat_xport_write.c +++ b/src/sas/readstat_xport_write.c @@ -117,7 +117,7 @@ static readstat_error_t xport_write_variables(readstat_writer_t *writer) { copypad(namestr.nlabel, sizeof(namestr.nlabel), variable->label); if (variable->format[0]) { - xport_format_t format; + xport_format_t format; retval = xport_parse_format(variable->format, strlen(variable->format), &format, NULL, NULL); @@ -128,16 +128,32 @@ static readstat_error_t xport_write_variables(readstat_writer_t *writer) { namestr.nfl = format.width; namestr.nfd = format.decimals; - copypad(namestr.niform, sizeof(namestr.niform), format.name); - namestr.nifl = format.width; - namestr.nifd = format.decimals; - if (strlen(format.name) > 8) { any_has_long_format = 1; needs_long_record = 1; } - } else if (variable->display_width) { + } else { namestr.nfl = variable->display_width; + namestr.nfd = variable->decimals; + } + + if (variable->informat[0]) { + xport_format_t informat; + + retval = xport_parse_format(variable->informat, strlen(variable->informat), + &informat, NULL, NULL); + + if (retval != READSTAT_OK) + goto cleanup; + + copypad(namestr.niform, sizeof(namestr.niform), informat.name); + namestr.nifl = informat.width; + namestr.nifd = informat.decimals; + + if (strlen(informat.name) > 8) { + any_has_long_format = 1; + needs_long_record = 1; + } } namestr.nfj = (variable->alignment == READSTAT_ALIGNMENT_RIGHT); @@ -185,13 +201,14 @@ static readstat_error_t xport_write_variables(readstat_writer_t *writer) { size_t label_len = strlen(variable->label); size_t name_len = strlen(variable->name); size_t format_len = strlen(variable->format); + size_t informat_len = strlen(variable->informat); int has_long_label = 0; int has_long_format = 0; has_long_label = (label_len > 40); if (variable->format[0]) { - xport_format_t format; + xport_format_t format; retval = xport_parse_format(variable->format, strlen(variable->format), &format, NULL, NULL); @@ -203,8 +220,21 @@ static readstat_error_t xport_write_variables(readstat_writer_t *writer) { } } + if (variable->informat[0]) { + xport_format_t informat; + + retval = xport_parse_format(variable->informat, strlen(variable->informat), + &informat, NULL, NULL); + if (retval != READSTAT_OK) + goto cleanup; + + if (strlen(informat.name) > 8) { + has_long_format = 1; + } + } + if (has_long_format) { - uint16_t labeldef[5] = { i+1, name_len, label_len, format_len, format_len }; + uint16_t labeldef[5] = { i+1, name_len, label_len, format_len, informat_len }; if (machine_is_little_endian()) { labeldef[0] = byteswap2(labeldef[0]); @@ -230,7 +260,7 @@ static readstat_error_t xport_write_variables(readstat_writer_t *writer) { if (retval != READSTAT_OK) goto cleanup; - retval = readstat_write_string(writer, variable->format); + retval = readstat_write_string(writer, variable->informat); if (retval != READSTAT_OK) goto cleanup; diff --git a/src/spss/readstat_por_read.c b/src/spss/readstat_por_read.c index 9f6f892..00783c5 100644 --- a/src/spss/readstat_por_read.c +++ b/src/spss/readstat_por_read.c @@ -372,6 +372,10 @@ static readstat_error_t read_missing_value_record(por_ctx_t *ctx) { } varinfo = &ctx->varinfo[ctx->var_offset]; + if (varinfo->n_missing_values >= 3) { + retval = READSTAT_ERROR_PARSE; + goto cleanup; + } if (varinfo->type == READSTAT_TYPE_DOUBLE) { if ((retval = read_double(ctx, &varinfo->missing_double_values[varinfo->n_missing_values])) != READSTAT_OK) { goto cleanup; @@ -382,10 +386,6 @@ static readstat_error_t read_missing_value_record(por_ctx_t *ctx) { goto cleanup; } } - if (varinfo->n_missing_values > 2) { - retval = READSTAT_ERROR_PARSE; - goto cleanup; - } varinfo->n_missing_values++; cleanup: diff --git a/src/stata/readstat_dta_read.c b/src/stata/readstat_dta_read.c index ce07c33..6e0b68c 100644 --- a/src/stata/readstat_dta_read.c +++ b/src/stata/readstat_dta_read.c @@ -36,9 +36,14 @@ static readstat_error_t dta_update_progress(dta_ctx_t *ctx) { } static readstat_variable_t *dta_init_variable(dta_ctx_t *ctx, int i, int index_after_skipping, - readstat_type_t type, size_t max_len) { + readstat_type_t type, size_t max_len, readstat_error_t *out_retval) { readstat_variable_t *variable = calloc(1, sizeof(readstat_variable_t)); + if (variable == NULL) { + if (out_retval) *out_retval = READSTAT_ERROR_MALLOC; + return NULL; + } + variable->type = type; variable->index = i; variable->index_after_skipping = index_after_skipping; @@ -317,10 +322,9 @@ static readstat_error_t dta_read_tag(dta_ctx_t *ctx, const char *tag) { static int dta_compare_strls(const void *elem1, const void *elem2) { const dta_strl_t *key = (const dta_strl_t *)elem1; const dta_strl_t *target = *(const dta_strl_t **)elem2; - if (key->o == target->o) - return key->v - target->v; - - return key->o - target->o; + if (key->o != target->o) + return (key->o > target->o) - (key->o < target->o); + return (key->v > target->v) - (key->v < target->v); } static dta_strl_t dta_interpret_strl_vo_bytes(dta_ctx_t *ctx, const unsigned char *vo_bytes) { @@ -952,7 +956,9 @@ static readstat_error_t dta_handle_variables(dta_ctx_t *ctx) { max_len = 0; } - ctx->variables[i] = dta_init_variable(ctx, i, index_after_skipping, type, max_len); + ctx->variables[i] = dta_init_variable(ctx, i, index_after_skipping, type, max_len, &retval); + if (ctx->variables[i] == NULL) + goto cleanup; const char *value_labels = NULL; diff --git a/tests/test_narwhalified.py b/tests/test_narwhalified.py index 3d9ec46..d78eb79 100644 --- a/tests/test_narwhalified.py +++ b/tests/test_narwhalified.py @@ -16,12 +16,14 @@ # ############################################################################# from datetime import datetime, timedelta, date +from concurrent.futures import ThreadPoolExecutor import unittest import os import sys import shutil import multiprocessing as mp import tempfile +import time import zipfile import io @@ -289,6 +291,7 @@ def test_xport(self): self.assertTrue(meta.number_columns == len(self.df_pandas.columns)) self.assertTrue(meta.number_rows == len(self.df_pandas)) self.assertTrue(meta.number_rows==len(df)) + self.assertTrue(meta.original_variable_informats['MYDATE'] == 'YYMMDD10') #self.assertTrue(meta.creation_time==datetime(2018, 8, 14, 10, 55, 46)) #self.assertTrue(meta.modification_time==datetime(2018, 8, 14, 10, 55, 46)) @@ -904,8 +907,11 @@ def test_xport_write_basic_v8(self): table_name = "TEST" col_labels = ["mychar label","mynum label", "mydate label", "dtime label", None, "myord label", "mytime label"] path = os.path.join(self.write_folder, "write.xpt") - pyreadstat.write_xport(self.df_pandas, path, file_label=file_label, column_labels=col_labels, table_name=table_name, file_format_version=8) + informats = {'mychar': '$1', 'mynum': 'BEST32', 'mydate': 'YYMMDD10', 'dtime': 'ANYDTDTM40', 'mylabl': 'BEST32', 'myord': 'BEST32', 'mytime': 'TIME20.3'} + pyreadstat.write_xport(self.df_pandas, path, file_label=file_label, column_labels=col_labels, table_name=table_name, + file_format_version=8, variable_informat=informats) df, meta = pyreadstat.read_xport(path, output_format=self.backend) + self.assertTrue(meta.original_variable_informats['mydate'] == 'YYMMDD10') df.columns = [x.lower() for x in df.columns] self.assertTrue(df.equals(self.df_pandas)) @@ -970,6 +976,12 @@ def test_xport_write_dates(self): df, meta = pyreadstat.read_xport(path, output_format=self.backend) self.assertTrue(df.equals(self.df_sas_dates2)) + def test_xport_write_fractional_seconds(self): + path = os.path.join(self.write_folder, "fractional_seconds.xpt") + pyreadstat.write_xport(self.df_sas_fractional_seconds, path) + df, meta = pyreadstat.read_xport(path, output_format=self.backend) + self.assertTrue(df.equals(self.df_sas_fractional_seconds)) + def test_sav_write_charnan(self): path = os.path.join(self.write_folder, "charnan.sav") pyreadstat.write_sav(self.df_charnan, path) @@ -1361,6 +1373,37 @@ def test_sav_write_mixed_types(self): df2, meta = pyreadstat.read_sav(path, output_format=self.backend) self.assertTrue(df_ori.to_native().equals(df2)) + def test_write_sav_locked_file(self): + """Test that writing to a locked or unwritable file raises PyreadstatError, not a crash (issue #328).""" + from pyreadstat._readstat_parser import PyreadstatError + import stat + + df = nw.from_native(self.df_pandas).to_native() + path = os.path.join(self.write_folder, "locked_write_test.sav") + + if os.name == "nt": + import msvcrt + pyreadstat.write_sav(df, path) + f = open(path, "r+b") + msvcrt.locking(f.fileno(), msvcrt.LK_NBLCK, 1) + try: + with self.assertRaises(PyreadstatError): + pyreadstat.write_sav(df, path) + finally: + msvcrt.locking(f.fileno(), msvcrt.LK_UNLCK, 1) + f.close() + os.remove(path) + else: + pyreadstat.write_sav(df, path) + os.chmod(path, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) + try: + if os.getuid() != 0: + with self.assertRaises(PyreadstatError): + pyreadstat.write_sav(df, path) + finally: + os.chmod(path, stat.S_IRWXU) + os.remove(path) + def test_read_sav_file_handle(self): """Test reading SAV file from file-like object (e.g., zip archive)""" sav_file = os.path.join(self.basic_data_folder, "sample.sav") @@ -1378,6 +1421,32 @@ def test_read_sav_file_handle(self): self.assertEqual(len(df.columns), len(self.df_pandas.columns)) self.assertEqual(len(df), len(self.df_pandas)) + def test_read_sav_bytesio_threads(self): + """Test reading SAV file from file-like object in multiple threads at once (tests thread safety)""" + + class SlowBytesIO(io.BytesIO): + """A BytesIO that sleeps a bit on each read. This subclass is necessary because we want + to test paralell threads reading at the same time, but the test data is so small that + the reads are too fast to overlap. """ + def read(self, *args, **kwargs): + time.sleep(0.001) + return super().read(*args, **kwargs) + + def read_sav_file(buffer): + df, meta = pyreadstat.read_sav(buffer, output_format=self.backend) + return df, meta + + sav_file = os.path.join(self.basic_data_folder, "sample.sav") + with open(sav_file, "rb") as f: + file_bytes = f.read() + num_threads = 5 + buffers = [SlowBytesIO(file_bytes) for _ in range(num_threads)] + with ThreadPoolExecutor(max_workers=num_threads) as executor: + results = list(executor.map(read_sav_file, buffers)) + for df, meta in results: + self.assertEqual(len(df.columns), len(self.df_pandas.columns)) + self.assertEqual(len(df), len(self.df_pandas)) + self.assertListEqual(list(df.columns), list(self.df_pandas.columns)) def test_read_sav_bytesio(self): """Test reading SAV file from BytesIO (simulates remote/streaming data)""" diff --git a/tests/test_typing.yml b/tests/test_typing.yml index 996e25a..92575dd 100644 --- a/tests/test_typing.yml +++ b/tests/test_typing.yml @@ -341,5 +341,5 @@ "var2": "ordinal", "var3": "scale", "var4": "unknown", - "var5": "another", # E: Dict entry 4 has incompatible type "str": "Literal['another']"; expected "str": "Literal['nominal', 'ordinal', 'scale', 'unknown']" [dict-item] + "var5": "another", # E: Dict entry 4 has incompatible type "str": "Literal['another']"; expected "str": "Literal['nominal', 'ordinal', 'scale', 'unknown', 'undetermined']" [dict-item] }