From e777dfeae6f61fa2e78b2a952a32bbe38570c05e Mon Sep 17 00:00:00 2001 From: Carl Sandrock Date: Sat, 25 Apr 2020 11:35:15 +0200 Subject: [PATCH 1/6] Fix typo formtas -> formats --- pyreadstat/pyreadstat.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyreadstat/pyreadstat.pyx b/pyreadstat/pyreadstat.pyx index 1ff5606..3621d34 100644 --- a/pyreadstat/pyreadstat.pyx +++ b/pyreadstat/pyreadstat.pyx @@ -197,7 +197,7 @@ def read_dta(str filename_path, metadataonly=False, dates_as_pandas_datetime=Fal by default False. If true it will change values in the dataframe for they value labels in the metadata, if any appropiate are found. formats_as_category : bool, optional - by default True. Takes effect only if apply_value_formtas is True. If True, variables with values changed + by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed for their formatted version will be transformed into pandas categories. encoding : str, optional Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an @@ -274,7 +274,7 @@ def read_sav(str filename_path, metadataonly=False, dates_as_pandas_datetime=Fal by default False. If true it will change values in the dataframe for they value labels in the metadata, if any appropiate are found. formats_as_category : bool, optional - by default True. Takes effect only if apply_value_formtas is True. If True, variables with values changed + by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed for their formatted version will be transformed into pandas categories. encoding : str, optional Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an @@ -350,7 +350,7 @@ def read_por(str filename_path, metadataonly=False, dates_as_pandas_datetime=Fal by default False. If true it will change values in the dataframe for they value labels in the metadata, if any appropiate are found. formats_as_category : bool, optional - by default True. Takes effect only if apply_value_formtas is True. If True, variables with values changed + by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed for their formatted version will be transformed into pandas categories. encoding : str, optional Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an From 463acc7590e9b353a62e3c018dbb2f5130c84b20 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Sat, 25 Apr 2020 18:51:42 +0200 Subject: [PATCH 2/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9a6c48e..1d6d9e1 100644 --- a/README.md +++ b/README.md @@ -742,4 +742,6 @@ pull request to ReadStat first. [benjello](/~https://github.com/benjello), [maxwell8888](/~https://github.com/maxwell8888), [drcjar](/~https://github.com/drcjar): improvements to documentation +[alchemyst](/~https://github.com/alchemyst): improvements to docstrings + [bmwiedemann](/~https://github.com/bmwiedemann), [toddrme2178 ](/~https://github.com/toddrme2178): improvements to source code From 22a24e8ef5da2d3ffcf27ee7f9e9b7e71e55fc88 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Thu, 30 Apr 2020 13:26:06 +0200 Subject: [PATCH 3/6] refreshed documenttation --- docs/_build/doctrees/environment.pickle | Bin 13732 -> 14392 bytes docs/_build/doctrees/index.doctree | Bin 174841 -> 174572 bytes .../html/_static/documentation_options.js | 1 + docs/_build/html/_static/searchtools.js | 5 +++- docs/_build/html/genindex.html | 23 ++++++++++++++-- docs/_build/html/index.html | 26 +++++++++--------- docs/_build/html/objects.inv | Bin 378 -> 389 bytes docs/_build/html/searchindex.js | 2 +- 8 files changed, 40 insertions(+), 17 deletions(-) diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index fef4b889bd244660fbd6f33c7873fa2e500817bc..423b6fc3906fcede981fea9f266ab2149fcbe2fd 100644 GIT binary patch delta 3369 zcmcImVQdsd6z;XxYfB3yrM)ZdwR@$sT-&>Auceg$K?(*`q%`0Ut*y)6-O}A*yL;K) zLyD4$iEWDO4>N;`F(nlu)re40gT|yvM1zo^CPod$h%q5)Fp7ykj3oGGcgtO`)bxJv z=X*2nz4_kEw=+9)V(+E5~uU~SzX`>KY-&(i9&X=XBxh zGbNj|D~qG77-KnISH(y|=QYwtgxxg1B#LjBR^X}99`AAuqH$Ie`(;i~s5~3tqI)%o z(*!b#mz8aCOyi!idcZ?v^_A0(tSmZy2^Wt`yueFwR*Wh#=|a=^d|9|^CcZQo-y2~Q zs$^y?bu+-z;$8u`%e@kCzv+3^?S=LS?k2!%ZdxnfL!&`YE8uQVJK)P6h@L&~$#X6d z7{kTy<7HhVT|zm&QCXWU~I|h zKY9^QGIdt-1^g4^h1fsLM#mUl>$~4^93Sv?IL7g$uP1yAvJ(-_SR^TOzb@($NPmzZ zN{+?>G{dPY(WGw-udk_SISvtlK_|fU5kDFOYZOSLrn92X4-iZm4grfF&E(E>td)*XEdl zj-`#YFn(c*Cn?x0^!Xi*&!ClvpbKDTi8G_krTGG1&lfm}!*va?ox^oCZPq+1axz#d z-5GE&F4cvH(zb#p6B?M^UA97LCKN-d9QRZ)C}eoHB;=?rDzfH#K#3*>cp3Xv_dwet*UM{cg}`P7GcY|Z&ho$oa-{7NtGgbveslmA*OQNQ#tXZzdS{_N&j+7xJV|` zwS_Bh@TUvMWLsNR;9F!H0K&e4rdFC&PQGzIF>Q4j4a1|96;|Dkd+|KH~Qq&NwHk#HbojVhM>~ zhi``5_`yJZvEkBSkrGdgfXZ_*e7m_3D?u-w3KTlN#Fqkb!1ci%z*mAXz*{DAA?o=g z^dw+qvkZ8+83F#?+zYs~h2m)wi^8aO0;YSA7@3DU=1fEcslQMh<;hnxENBh6B>qR^^z$PXmVW(YD}* zRwsPhVpie~46?e)$?(|L>9a*>GxGX*nO8Z97`YG0F@8VM;rc)wFhFQS_klrc@RHT_ zL#v_bPxTu`+sz~3n`hWY7%)PHNd$J1OXE2;DiE}V@-k>HS>Y}-!`IFA^K+-L)j5D8qlAw=8MV7b-FVXYjM`6e}L12an+5kOc7NO~; b)3oObNwh?fU1*pj=nts9)A1O7w7vU3i^(e4 delta 3116 zcmcImUu+ab7{6_Mcl`s}6zP?6Wv`U>uJrGnwvARpF$NGqX+lKWS}uEcLvM$@-E()Z zX-V)fDuiSnkQuEKFpy}`s4-1RQ!rxG8kNMv#6+SI(a3{7AWuG+@ZdMQ*Soe{limX_ zznS^IncvL!n{WQiCEq>bJYMp~+g;Pnbk)psRc{fkUq3|8ukRCX(%;rM0XnNWwpMQd z+)*8T>Zagu^q*v;Qc5Nj6h}%jd?XT1=?d$|3%*BkJ{=`A6D|1Z@jD@o?|7Cj@xg(*;;t1Kyb(HSUrIvc?zi>qtS8f&9&kxX>6k$Nc#k&u%tgaiduP#_4kSZe? zm(}t1n3j-a)o9lZlkE{^PSw3Gl#*hkj&4*O!6Jua=k^=#UwyN3SAvGc zCxk(IR@~=$1?>0)y(>1_)mLe)&kMdDU!O2Z$9>y`b9BzvEu5uyeM7;wpm!=_ka9&+ zM@`vOkim{I%*pXt0E3j6S~O>yq(|#(JI{e9F5>f0jIaQngp!mgvSEg06D1gB%`XE> z059~T^YvZb3k_>fW{i#wBOR$xbpIH;+XdROx%){z6u-w|ioP~D*PpQh#M3&b+ls4s|pKL(StrkP=5A`#IPhQrXC zxc1wv>^n16M0;C9bg*Th&&jX%>=c~XDXTFwo@Lzw7cg9zx}1CI;0+7FV=b$r3Zkb& zHD$g)LW`vo)J$)+HaYPu=tv)Gd)~z>q=)_yT1Q`MJ1ET38*M{?q4pTyq=om|hsv#P z?K+ZTbUN5dNk=odXFF8D#!d`)y7L9VI~MK^^7^G9K5z!uk1^u5=Ux&+NkTH?RtT9+ zYvYm;MlYr;#j?-yDI+UqQF6lWPY;De`~7p-#OwsapTbnuBTq^XXD$P7zLwwoMSk;q ze)Bi?o70^9`u%op{yx9?hy3Or^P7LlZ~i%BPCJ&y`D^~}xAK}(_%_(#Q}hoM0ZX;G z7#B~OET?uc|Elq?h`l}8T_`rp7})7AT~)#vdZ(*S@X(6xwp}$PkVp@Q73t_i*wiJ} zP$ZN82OtZrFCb*WC{mFwDU3Luwer`5n+AJf9IoTAiGxVTx|`CqPz@||ku`g*4EC)& z*bl=_!VW~>C+#wjq(|cnw}BCUc6li)_FJ8N1JWpBx#fg&>uJwXrucVDQxz$K6rP^} s>;b0*aS^t?5n7}oInf45X&+F_%;(Q6;spG!tZQJZXS>i#|LPg|AC`;3I{*Lx diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 846c60015a188a2f3aa81f2841ffe61e02012c61..df70dbb47fed2072cb30897ec70e75e2d73e00e9 100644 GIT binary patch delta 2768 zcmZveYfw~W7{`4c*u(DPdLzJAFm`7Z*d&5Qs2oev5XU4-Yo-tAEJ7|vyav(DU^8PZ zy5L!S4B1_vNx&{6ZMsu^P`Z5RLmwIwYMjxWa!N%hoiUv37Jm>(3Cxp^D1R?p zv;4$=+eJ%$b#rZfAZu5sATYZoBrDwJ4>)T=fgJwMJOi5mr!s(UkyQ-m!X13uP=v0)KUWfe@v_J+NRD7-Z&__$B;-kt3t)yS_w)?u+*7^J!2JhtFYgQkYQ=*O>o7+!ETQv zKWP&T6^HIK7`{BzY%r`I$k7-+9}o;z29`5}Z_uBc)IKydu_{+~NQ6RTStI*pu+&WD zb?@gPCMgp$RJzXOItjY{L;D_(WS2wG6Hb-|N`)d!s+1Rtj^D}v$I%FkrAYFp+~ud{R4{l5EMNdp zmjyH;vP!^6v`7MGqCFBY6pc%uQ;7>F<*WreZAgP@x=<8M1Kq#;+jO#7BGmkgUrvL? zt0cLf8~x;6Yi2sO77Pn%$vV(Hq>t9AOy|}CyGZjN2i-=GGqE_^SS~`djWqT+7(NoL z#5-L)#^hsSit3~2F(~&w0WVfc@-R30$r3hGc81|O-AcM60&|mI(pwRg@{0&mGNmmF z8(Fz6QIm3f;iSsmcDMg1tNk9&{aLWf!Ut2wu|bzgU6U$PfSr=we*Oj(vvTobgIgvr`Xo|sZ(C8Yv~f9uH}}M z*ig>bpOP zE12_45bHF3p-k5|LxhIDw&b%N$|%^4Idtr0G>%SH>=d405<4+p75kRYs3kAHY&WjY zmgF~ixS#sEwOX=f7_SHg@@}q#at`9hwvKY1oGHInF5XNEl&khsOA%kUleGs|XNN^E z-_CLYKh?F;Et)H&-V1+0?f<^R17`+gsU>J+x zAPt8x9}duuVO&&n@_(1tTMu!!p7bOwjc~TpYPOUDd6=G$phwI2Ln7mOk?}70k{nTV z!6}jRPRoN_&v&N0bErRxbHPF*QOwM?R3uBBkj+AuqnMZN;Lhe+zy5M14wlKO?X;#B zD=@o)&T_S!JKl?TU|NMzvcM}X6~%E+(tx#r?NTn_E=ras(-@KpTwck#oN8Lx1W za!~v%;bih+DjCGwLeW~Swp2FXzGHyH75DECmw5WXla7U|mKu_3I4e*p~fSPK9E delta 3144 zcmZ{meQeW37{_^zuC(2Y!ZtPwTen&0SSUgVg#-`*84{#UVQ7p43KY7Z;9zV53U2F!dG7Al_SaDR$Mx>HYoE`3 zpXZ*tyWg7rylB!j>Y5Mr>qeEE^jm7)Siiv&Y$~LmPt7$Jm2RwE+pxhifzB+Cq$z$f zY}mlv@+W|F5!&A~+0cmwZ?1BL&Y4yP9kh8`2{|QZvQMfr{0qFpz2lTV`fyt1($kOH zxy9ycSnctS-We?Q=2r)m!)SAR&DBBg*!ZXrM@7}arnGf6bzAC#dzzLzV+~R2CHGz#TJNtOHYtVjHE+0Xa&c)g)Xdv|>|qz{M&Yc=zr< z*{C24;~%;td@Wi7Fhm3>+n|F4DZ8VCWYl7b`7U&_ae6>TR;!0~v6$xO#A9mXU2RO+ zxDkLseH`s6gPMmE67>2@0@M;cI|61emRMt#YO#(ig;-z<+b}OC_=Egtq%|4pJnpqC zx47R7dPh_TOBI=dj4p$Cz^!H;@RlktA$)ojV6@rBDu_$W2WB={1^GFO#hes{wOtFpxdXN*!vAjv6snU zSc7a!IyG!KFtd*@fQg;y1WZMHQEI@JaDwkCT%+m(E`w)`1IyOFl=MnbY1E`55XuU1&V-N2pCFq{t zc!JiVJw<{#pp|`MBBI&ek;3f%Jx$!ddoGg;YYAIT>2GK$rIVJu+X&k;O!mZwtF8pq>=EMkgJ&6Np@ zNR3mX9rtO`tc~PtH7|;j@*-X4#kNhgb@j=aG0rcTU-6TLm>FR|SsRlWrp6`C=G`QT zm+j&bKP>+r=;8PS2|c+@Ko>^;+C^66N$A(xV$h>mUmHoMv&t>(bQ?Kk-0wt3xyn8# zzI96JkV%(j$6+dAFAOQ^O-qX1;`|yHHv3-(1otNp50zcK;qOV=@Hdxuc!^hzZ1~$kJU7JUEgOC_itABaL9*e6Uetb3LuJDYlBiMQ zgv*AX9y~%mY2WPHQD(Nn*DlV^*#)fJbr3i(_L=XD9pfItigynsLp z2&{lW3J9ElKnVzpfItWc_qYcA2b71U=sTcrzpe&vK7T)~_m(Nu=*qiM%Cd&b;&-wS vdx(wT_vbyN=*eFE0cHcAQ!D6h-nA_Td_D>xk1%V5?9lVgD1m5qgjB$P_6*`3 diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js index b7bd83c..d2e2581 100644 --- a/docs/_build/html/_static/documentation_options.js +++ b/docs/_build/html/_static/documentation_options.js @@ -5,6 +5,7 @@ var DOCUMENTATION_OPTIONS = { COLLAPSE_INDEX: false, BUILDER: 'html', FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', NAVIGATION_WITH_KEYS: false diff --git a/docs/_build/html/_static/searchtools.js b/docs/_build/html/_static/searchtools.js index d11b33a..ab56499 100644 --- a/docs/_build/html/_static/searchtools.js +++ b/docs/_build/html/_static/searchtools.js @@ -251,6 +251,7 @@ var Search = { var item = results.pop(); var listItem = $('
  • '); var requestUrl = ""; + var linkUrl = ""; if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { // dirhtml builder var dirname = item[0] + '/'; @@ -260,13 +261,15 @@ var Search = { dirname = ''; } requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname; + linkUrl = requestUrl; } else { // normal html builders requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX; + linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX; } listItem.append($('').attr('href', - requestUrl + + linkUrl + highlightstring + item[2]).html(item[1])); if (item[3]) { listItem.append($(' (' + item[3] + ')')); diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index b3312c3..9dd9609 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -145,17 +145,36 @@

    Index

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

    M

    + + +
    +

    P

    diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index a9040c6..828e33c 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -196,7 +196,7 @@

    Metadata Object Description

    Functions Documentation

    -
    +
    pyreadstat.pyreadstat.read_dta()

    Read a STATA dta file

    @@ -237,7 +237,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.read_file_in_chunks()

    Returns a generator that will allow to read a file in chunks.

    @@ -263,7 +263,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.read_por()

    Read a SPSS por file

    @@ -301,7 +301,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.read_sas7bcat()

    Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary @@ -330,7 +330,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.read_sas7bdat()

    Read a SAS sas7bdat file. @@ -376,7 +376,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.read_sav()

    Read a SPSS sav or zsav (compressed) files

    @@ -417,7 +417,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.read_xport()

    Read a SAS xport file.

    @@ -451,7 +451,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.set_catalog_to_sas()

    Changes the values in the dataframe and sas_metadata according to the formats in the catalog. @@ -477,7 +477,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.set_value_labels()

    Changes the values in the dataframe according to the value formats in the metadata. @@ -501,7 +501,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.write_dta()

    Writes a pandas data frame to a STATA dta file

    @@ -525,7 +525,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.write_por()

    Writes a pandas data frame to a SPSS POR file.

    @@ -542,7 +542,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.write_sav()

    Writes a pandas data frame to a SPSS sav or zsav file.

    @@ -575,7 +575,7 @@

    Metadata Object Description +
    pyreadstat.pyreadstat.write_xport()

    Writes a pandas data frame to a SAS Xport (xpt) file. diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index 2e297ecce566a69ff402f95b5a29ddf4105ce953..322f15088a7c332224a671eed590256487143c41 100644 GIT binary patch delta 277 zcmV+w0qXwx0)+#Rd4H3^YQr!LhVOX_jqRGSo(6q`9R`IRb~LW7CT5OpVx?6d3gd+8M)w(uZGs<)*(l@7R`C+b4S)2%4EDwBA&p+tIUU7S;XmxZMK@<4l3veif_eq#?5u;= z999>Z_9}}OiVw8P_XycV#jVcv{hCyVd^#%Vlu1C4gYx%M8~Cfwq6B@miq z5!ffE$an|qYl&aDdt*@;C)AMKTdbA|eyZk186S6whfpt||9>TLsOBDX>s8JXN#w4j z^}Qfpny6JdNSjbtxkFo}@je;C+F!)v%J*k-<@lNWhxzyDmJCGFn`KPUuHl?raPU;Z z<^t1R70?x8i&ps&fjnF;@p<})kg;h*myg;0uE|S#!!FG2xxjkQyzgurQBG?3$>1D= QU%CDwdu+Y{@dLn)f#L> Date: Wed, 20 May 2020 08:33:12 +0200 Subject: [PATCH 4/6] recythonized on linux --- pyreadstat/_readstat_parser.c | 133 ++++++++++++++++++++++++++++------ pyreadstat/_readstat_writer.c | 28 +++---- pyreadstat/pyreadstat.c | 71 +++++++++++------- 3 files changed, 171 insertions(+), 61 deletions(-) diff --git a/pyreadstat/_readstat_parser.c b/pyreadstat/_readstat_parser.c index cc3f89e..827d9e8 100644 --- a/pyreadstat/_readstat_parser.c +++ b/pyreadstat/_readstat_parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.15 */ +/* Generated by Cython 0.29.17 */ /* BEGIN: Cython Metadata { @@ -81,8 +81,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_15" -#define CYTHON_HEX_VERSION 0x001D0FF0 +#define CYTHON_ABI "0_29_17" +#define CYTHON_HEX_VERSION 0x001D11F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -558,8 +558,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif +#endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) @@ -1395,6 +1397,17 @@ static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_nam #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); @@ -1418,7 +1431,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -/* CythonFunction.proto */ +/* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED 1 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -1446,6 +1459,7 @@ typedef struct { PyObject *func_classobj; void *defaults; int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -1454,9 +1468,7 @@ typedef struct { } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) -#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ - __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) -static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, @@ -1472,6 +1484,13 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 #define __Pyx_SetNameInClass(ns, name, value)\ @@ -11918,7 +11937,7 @@ if (!__Pyx_RefNanny) { * self.column_names = list() * self.column_labels = list() */ - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10pyreadstat_16_readstat_parser_18metadata_container_1__init__, 0, __pyx_n_s_metadata_container___init, NULL, __pyx_n_s_pyreadstat__readstat_parser, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_18metadata_container_1__init__, 0, __pyx_n_s_metadata_container___init, NULL, __pyx_n_s_pyreadstat__readstat_parser, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(1, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -13558,6 +13577,53 @@ static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_nam } #endif +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyObjectGetAttrStrNoError */ +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +} + /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; @@ -13603,15 +13669,23 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { - reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD; - ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; - ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { - setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD; - ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; - ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } } PyType_Modified((PyTypeObject*)type_obj); } @@ -13725,7 +13799,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { { #if PY_MAJOR_VERSION >= 3 if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { @@ -13813,7 +13887,7 @@ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { goto done; } -/* CythonFunction */ +/* CythonFunctionShared */ #include static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) @@ -14120,10 +14194,9 @@ static PyMethodDef __pyx_CyFunction_methods[] = { #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif -static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); - if (op == NULL) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + if (unlikely(op == NULL)) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; @@ -14144,12 +14217,12 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; + op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; - PyObject_GC_Track(op); return (PyObject *) op; } static int @@ -14397,6 +14470,7 @@ static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; + m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -14415,6 +14489,19 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py Py_INCREF(dict); } +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); @@ -14523,7 +14610,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -14627,7 +14714,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index e89e443..c8bb151 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.15 */ +/* Generated by Cython 0.29.17 */ /* BEGIN: Cython Metadata { @@ -81,8 +81,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_15" -#define CYTHON_HEX_VERSION 0x001D0FF0 +#define CYTHON_ABI "0_29_17" +#define CYTHON_HEX_VERSION 0x001D11F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -558,8 +558,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif +#endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) @@ -934,7 +936,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "pyreadstat/_readstat_writer.pxd":49 +/* "pyreadstat/_readstat_writer.pxd":51 * wchar_t* PyUnicode_AsWideCharString(object, Py_ssize_t *) * * ctypedef enum dst_file_format: # <<<<<<<<<<<<<< @@ -951,7 +953,7 @@ enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format; -/* "pyreadstat/_readstat_writer.pxd":57 +/* "pyreadstat/_readstat_writer.pxd":59 * FILE_FORMAT_POR * * ctypedef enum pywriter_variable_type: # <<<<<<<<<<<<<< @@ -8020,7 +8022,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(filename_path, &length) # <<<<<<<<<<<<<< * flags = _O_WRONLY | _O_CREAT | _O_BINARY - * fd = _wsopen(u16_path, flags, _SH_DENYRD, 0) + * fd = _wsopen(u16_path, flags, _SH_DENYRD, _S_IREAD | _S_IWRITE) */ __pyx_v_u16_path = PyUnicode_AsWideCharString(__pyx_v_filename_path, (&__pyx_v_length)); @@ -8028,7 +8030,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(filename_path, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY # <<<<<<<<<<<<<< - * fd = _wsopen(u16_path, flags, _SH_DENYRD, 0) + * fd = _wsopen(u16_path, flags, _SH_DENYRD, _S_IREAD | _S_IWRITE) * else: */ __pyx_v_flags = ((_O_WRONLY | _O_CREAT) | _O_BINARY); @@ -8036,11 +8038,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f /* "pyreadstat/_readstat_writer.pyx":489 * u16_path = PyUnicode_AsWideCharString(filename_path, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY - * fd = _wsopen(u16_path, flags, _SH_DENYRD, 0) # <<<<<<<<<<<<<< + * fd = _wsopen(u16_path, flags, _SH_DENYRD, _S_IREAD | _S_IWRITE) # <<<<<<<<<<<<<< * else: * filename_bytes = filename_path.encode("utf-8") */ - __pyx_v_fd = _wsopen(__pyx_v_u16_path, __pyx_v_flags, _SH_DENYRD, 0); + __pyx_v_fd = _wsopen(__pyx_v_u16_path, __pyx_v_flags, _SH_DENYRD, (_S_IREAD | _S_IWRITE)); /* "pyreadstat/_readstat_writer.pyx":486 * IF PY_MAJOR_VERSION >2: @@ -8053,7 +8055,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f } /* "pyreadstat/_readstat_writer.pyx":491 - * fd = _wsopen(u16_path, flags, _SH_DENYRD, 0) + * fd = _wsopen(u16_path, flags, _SH_DENYRD, _S_IREAD | _S_IWRITE) * else: * filename_bytes = filename_path.encode("utf-8") # <<<<<<<<<<<<<< * path = filename_bytes @@ -14875,7 +14877,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { { #if PY_MAJOR_VERSION >= 3 if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { @@ -14926,7 +14928,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -15030,7 +15032,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } diff --git a/pyreadstat/pyreadstat.c b/pyreadstat/pyreadstat.c index 2932d35..9e591f5 100644 --- a/pyreadstat/pyreadstat.c +++ b/pyreadstat/pyreadstat.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.15 */ +/* Generated by Cython 0.29.17 */ /* BEGIN: Cython Metadata { @@ -81,8 +81,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_15" -#define CYTHON_HEX_VERSION 0x001D0FF0 +#define CYTHON_ABI "0_29_17" +#define CYTHON_HEX_VERSION 0x001D11F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -558,8 +558,10 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif +#endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) @@ -935,7 +937,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "_readstat_writer.pxd":49 +/* "_readstat_writer.pxd":51 * wchar_t* PyUnicode_AsWideCharString(object, Py_ssize_t *) * * ctypedef enum dst_file_format: # <<<<<<<<<<<<<< @@ -952,7 +954,7 @@ enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format; -/* "_readstat_writer.pxd":57 +/* "_readstat_writer.pxd":59 * FILE_FORMAT_POR * * ctypedef enum pywriter_variable_type: # <<<<<<<<<<<<<< @@ -1306,7 +1308,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* k /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -/* CythonFunction.proto */ +/* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED 1 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -1334,6 +1336,7 @@ typedef struct { PyObject *func_classobj; void *defaults; int defaults_pyobjects; + size_t defaults_size; // used by FusedFunction for copying defaults int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -1342,9 +1345,7 @@ typedef struct { } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) -#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ - __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) -static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, @@ -1360,6 +1361,13 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); @@ -3095,7 +3103,7 @@ static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_2read_xport(CYTHON_UNUSED Py /* Python wrapper */ static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_5read_dta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_10pyreadstat_10pyreadstat_4read_dta[] = "\n Read a STATA dta file\n\n Parameters\n ----------\n filename_path : str\n path to the file. The string is assumed to be utf-8 encoded\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formtas is True. If True, variables with values changed\n for their formatted version will be transformed into pandas categories.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n will be deliver as is, and an extra piece of information will be set in the metadata (missing_user_values)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user ca""n use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n\n Returns\n -------\n data_frame : pandas dataframe\n a pandas data frame with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "; +static char __pyx_doc_10pyreadstat_10pyreadstat_4read_dta[] = "\n Read a STATA dta file\n\n Parameters\n ----------\n filename_path : str\n path to the file. The string is assumed to be utf-8 encoded\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed\n for their formatted version will be transformed into pandas categories.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n will be deliver as is, and an extra piece of information will be set in the metadata (missing_user_values)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user ca""n use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n\n Returns\n -------\n data_frame : pandas dataframe\n a pandas data frame with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "; static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_5read_dta = {"read_dta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_5read_dta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_4read_dta}; static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_5read_dta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename_path = 0; @@ -3659,7 +3667,7 @@ static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_4read_dta(CYTHON_UNUSED PyOb /* Python wrapper */ static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_7read_sav(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_10pyreadstat_10pyreadstat_6read_sav[] = "\n Read a SPSS sav or zsav (compressed) files\n\n Parameters\n ----------\n filename_path : str\n path to the file. The string is assumed to be utf-8 encoded\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formtas is True. If True, variables with values changed\n for their formatted version will be transformed into pandas categories.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n will be deliver as is, and an extra piece of information will be set in the metadata (missing_ranges)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python obj""ect, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n\n Returns\n -------\n data_frame : pandas dataframe\n a pandas data frame with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "; +static char __pyx_doc_10pyreadstat_10pyreadstat_6read_sav[] = "\n Read a SPSS sav or zsav (compressed) files\n\n Parameters\n ----------\n filename_path : str\n path to the file. The string is assumed to be utf-8 encoded\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed\n for their formatted version will be transformed into pandas categories.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n will be deliver as is, and an extra piece of information will be set in the metadata (missing_ranges)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python obj""ect, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n\n Returns\n -------\n data_frame : pandas dataframe\n a pandas data frame with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "; static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_7read_sav = {"read_sav", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_7read_sav, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_6read_sav}; static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_7read_sav(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename_path = 0; @@ -4223,7 +4231,7 @@ static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_6read_sav(CYTHON_UNUSED PyOb /* Python wrapper */ static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_9read_por(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_10pyreadstat_10pyreadstat_8read_por[] = "\n Read a SPSS por file\n\n Parameters\n ----------\n filename_path : str\n path to the file. The string is assumed to be utf-8 encoded\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formtas is True. If True, variables with values changed\n for their formatted version will be transformed into pandas categories.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited t""o year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n\n Returns\n -------\n data_frame : pandas dataframe\n a pandas data frame with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "; +static char __pyx_doc_10pyreadstat_10pyreadstat_8read_por[] = "\n Read a SPSS por file\n\n Parameters\n ----------\n filename_path : str\n path to the file. The string is assumed to be utf-8 encoded\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed\n for their formatted version will be transformed into pandas categories.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited t""o year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n\n Returns\n -------\n data_frame : pandas dataframe\n a pandas data frame with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "; static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_9read_por = {"read_por", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_9read_por, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_8read_por}; static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_9read_por(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename_path = 0; @@ -5476,7 +5484,7 @@ static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_12set_value_labels(CYTHON_UN __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_apply); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10pyreadstat_10pyreadstat_16set_value_labels_lambda, 0, __pyx_n_s_set_value_labels_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyreadstat_pyreadstat, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_16set_value_labels_lambda, 0, __pyx_n_s_set_value_labels_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyreadstat_pyreadstat, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -9160,7 +9168,7 @@ static int __Pyx_ParseOptionalKeywords( } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { @@ -9187,7 +9195,7 @@ static int __Pyx_ParseOptionalKeywords( while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -9203,7 +9211,7 @@ static int __Pyx_ParseOptionalKeywords( while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -9883,7 +9891,7 @@ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { goto done; } -/* CythonFunction */ +/* CythonFunctionShared */ #include static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) @@ -10190,10 +10198,9 @@ static PyMethodDef __pyx_CyFunction_methods[] = { #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif -static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); - if (op == NULL) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + if (unlikely(op == NULL)) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; @@ -10214,12 +10221,12 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; + op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; - PyObject_GC_Track(op); return (PyObject *) op; } static int @@ -10467,6 +10474,7 @@ static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; + m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -10485,6 +10493,19 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py Py_INCREF(dict); } +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; @@ -11276,7 +11297,7 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { { #if PY_MAJOR_VERSION >= 3 if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { + if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { @@ -11327,7 +11348,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -11431,7 +11452,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } From 9be789f9de2abee6a135b204c7493f0e329ad0dd Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Wed, 20 May 2020 16:28:36 +0200 Subject: [PATCH 5/6] updated Readstat source to 3a53c088cb622f10a02723bbfd9b91d316995aab. Version bumped. --- change_log.md | 5 +++++ docs/_build/doctrees/environment.pickle | Bin 14392 -> 14540 bytes docs/_build/doctrees/index.doctree | Bin 174572 -> 174572 bytes docs/_build/html/.buildinfo | 2 +- .../html/_static/documentation_options.js | 2 +- docs/_build/html/genindex.html | 4 ++-- docs/_build/html/index.html | 10 ++++----- docs/_build/html/py-modindex.html | 4 ++-- docs/_build/html/search.html | 4 ++-- docs/_build/html/searchindex.js | 2 +- docs/conf.py | 4 ++-- pyreadstat/__init__.py | 2 +- setup.py | 2 +- src/sas/readstat_sas_rle.c | 21 ++++++++++++++++-- src/sas/readstat_xport_write.c | 10 +++++---- src/spss/readstat_sav.c | 10 ++++++++- 16 files changed, 57 insertions(+), 25 deletions(-) diff --git a/change_log.md b/change_log.md index 6603e86..9608d37 100644 --- a/change_log.md +++ b/change_log.md @@ -1,3 +1,8 @@ +# 0.3.4 (github, pypi and conda 20200520) +* corrected bug when writing and updating files fixes #17 +* updated Readstat source to commit 3a53c088cb622f10a02723bbfd9b91d316995aab: better error message when the + file is not a spss file + # 0.3.3 (github, pypi and conda 20200424) * added capability to set_value_labels to handle subset of dataframes, solves #58 diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 423b6fc3906fcede981fea9f266ab2149fcbe2fd..31dd484a6f59444d59885677d76e35fa4e481e60 100644 GIT binary patch delta 2846 zcmcImZ%kWN6mOyBPs`#5qbOr*8Do?`g|-yB;3i`s8$w_h5?oM5Udx5{rhP5%y%Jb5 znK2GY-iMjNT zQguZqa3Pg^@&{|VTI6(9N+e1InN(J3Y91LQq9SYEYJNhBQxZ}%c(Js+P|cI2&`?Cu z;C!jWrsj_kNsh!tEp@qcBBwyjCE}PC&V|3NWl-ku?itQ8nNGH@E}T+UI{RSI(QF=u zw;iYQF5)@`Sa($D<{MDrEXBQm^O$)C#+@zZIaqQwnP*|$+3&rA-pQb>+M;oBM2RR- zB5UU~%E;*~f~;DUcqqL#182)hJaf1ccF?Oh3}`MogQHp)jmXMiL?JN^w5nH-#YH## z;PbM^ri}?dWSo)6Fp-EDBL6?5yIqI+15HQRQF?I^s$1R-b+USXq-6@`?7&OtZHaWgTD;cC;96Y9Y$zg`9FJ5=Sa&^D_?l+C zbU1rj7cQJlxQ1|jRj%#Ak!)x(lTHg4%!Z;TlViJZS%3K^dJDR$SxrQ$k0V~Ijuf+> zM$PM;hy~-(^n0Iz+M3s`bObkHv1b2XZgrZHYC$NX2&_zbE8+VOYTO6k#iVEyz3F>s zZMGU#v)yzCm%8Z{Xs-45&T{($j&q39^eQ6uiEDgF230F-1-!R0c6O&VA`X%9%?ms6 zvBu|BiWprHZq%momhre6fM0x%!^`f|=4DuQ_apl1h7jN4_-|dmjl0!JL>PhvZ!M_x zRk*!aFCtcWDB?xWONeV6JG{)E_0qn1WIv~=`LXy=(rCsT!C7L066UcPPJ6KGH&2_e8mxVFo zfvOyu6#U3( z3!bCL7_>4t4r5J+CXb@&+P0+@b@AWMx%1%;JT|3W(1KI!S|UiHuts}u5&u*@l+xbI zot!GbpFwF)Ot`Ur^jcQ8%pee`J<*K5ltI{WL8I+xY<1$xEF2>ybb5i! TP8&y(y0Y&FTFoK&Ezt8HqX=i_ delta 2793 zcmcImZ%iCT6u*Vz_;YPZ8mKJ-dz4b3<$(JGoY>ZqHa1E@teTj%c~TOl)eJnkM?eL{0R~%mD|2;Xd@s zZ{C}E`+M_#yEAWRk5Ba2PukDBFWVI%YooW`6Cj$fU+|4j2sL?vkKA+yz$smK1f1~` zn{H%nK%(hTo>x>|v)a*SVicEWpd2z>EM}n6@tNY@3|o-~6>>>z7G!c$e9Z9*%;R&U*;P@_%vZrT?OkD6w}|z!b;vRudRUJrn$>4vnVfd* z6%yog*F%mG8n~TYcNLP7vSMMFG?yJdG6a)GNHg;yF||A8Ihte`Kr`)nOy*p4E&*UV zLq;T`=)p)>qe-hzL8>ZD`H_e(z|aY9g4`|JoHIX3^0ziTFz>JkPL&&1jwx|Pm6cV9 z@I{Cwb1vU5`ZRuz!Wf0?07gi{@54ybe*j~rg+JuOM|}904-@3h*8BTqaLhbOl~F9N zN>Rl^qJbx263zh%0)Gm_5@m9e(%@($`eI@({#Ly+hCdwEoQ_)PSf+o<5lF^wt{|E*ex2iR=HTBB4ZQ&xBtf&@70Ly%QpGBEzluEx0I9X3_ z_w+CO6z)rh26nf?r%;d%ML3n?-YOQYtN_KLl_g2V_N24Vq+W+z>6_k%Y zRf|YE{r^BdGrL<+mADkK%q%$W%8Qn6ow9HvJb-+-2?iVh7_iP*p#jUxA(xxB_^=3K1Ron(E uYNOo=6v`43l5FL=rrxH-)C0~17`YWlqwj9in?1einkwVRs)1#(do hC+x?ncr*Xu$t#c*ZZF7T#HzAgzJPJNd;!y0O8}(GJtF`B delta 142 zcmaEJnd{AEt_>YNOeKkv`43l5FL=rrxH-)C0~17`YWlqwj9in?1einkwVRs)1#(do hC+x?ncr*Xu$t#c*ZZF7T#HzAgzJPJNd;!y0O8}*HJtF`B diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo index ba35eb2..d90bd1a 100644 --- a/docs/_build/html/.buildinfo +++ b/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e5aad791b428aec4c4ae13c2e09050db +config: e5ce19c8c6330853c8402c36ade8ae00 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js index d2e2581..474dc39 100644 --- a/docs/_build/html/_static/documentation_options.js +++ b/docs/_build/html/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '0.3.3', + VERSION: '0.3.4', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 9dd9609..f631ec0 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -9,7 +9,7 @@ - Index — pyreadstat 0.3.3 documentation + Index — pyreadstat 0.3.4 documentation @@ -240,7 +240,7 @@

    W

    - © Copyright 2018, Otto Fajardo + © Copyright 2018-2020, Otto Fajardo

    diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index 828e33c..9251804 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -8,7 +8,7 @@ - Welcome to pyreadstat’s documentation! — pyreadstat 0.3.3 documentation + Welcome to pyreadstat’s documentation! — pyreadstat 0.3.4 documentation @@ -209,7 +209,7 @@

    Metadata Object Description

    - © Copyright 2018, Otto Fajardo + © Copyright 2018-2020, Otto Fajardo

    diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html index de16072..b44e355 100644 --- a/docs/_build/html/py-modindex.html +++ b/docs/_build/html/py-modindex.html @@ -8,7 +8,7 @@ - Python Module Index — pyreadstat 0.3.3 documentation + Python Module Index — pyreadstat 0.3.4 documentation @@ -176,7 +176,7 @@

    Python Module Index

    - © Copyright 2018, Otto Fajardo + © Copyright 2018-2020, Otto Fajardo

    diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html index f330bc4..3894e60 100644 --- a/docs/_build/html/search.html +++ b/docs/_build/html/search.html @@ -8,7 +8,7 @@ - Search — pyreadstat 0.3.3 documentation + Search — pyreadstat 0.3.4 documentation @@ -165,7 +165,7 @@

    - © Copyright 2018, Otto Fajardo + © Copyright 2018-2020, Otto Fajardo

    diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 1db8c7a..54e5b1d 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst"],objects:{"pyreadstat.pyreadstat":{read_dta:[0,1,1,""],read_file_in_chunks:[0,1,1,""],read_por:[0,1,1,""],read_sas7bcat:[0,1,1,""],read_sas7bdat:[0,1,1,""],read_sav:[0,1,1,""],read_xport:[0,1,1,""],set_catalog_to_sas:[0,1,1,""],set_value_labels:[0,1,1,""],write_dta:[0,1,1,""],write_por:[0,1,1,""],write_sav:[0,1,1,""],write_xport:[0,1,1,""]},pyreadstat:{pyreadstat:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"boolean":0,"case":0,"default":0,"import":0,"int":0,"return":0,"true":0,For:0,SAS:0,That:0,The:0,There:0,Use:0,Will:0,abl:0,about:0,accept:0,accord:0,account:0,add:0,added:0,addit:0,after:0,align:0,all:0,allow:0,also:0,alwai:0,ani:0,annot:0,anyth:0,appear:0,appli:0,applic:0,apply_value_format:0,apply_value_formta:0,appropi:0,appropri:0,argument:0,assum:0,attach:0,attempt:0,behavior:0,being:0,between:0,beyond:0,bool:0,both:0,boundari:0,can:0,cannot:0,catalog:0,catalog_fil:0,catalog_metadata:0,categori:0,center:0,certain:0,chang:0,charact:0,chunk:0,chunksiz:0,column:0,column_label:0,column_nam:0,column_names_to_label:0,combin:0,come:0,compat:0,compress:0,consid:0,contain:0,convers:0,convert:0,copi:0,correct:0,could: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,defin:0,deliv:0,describ:0,determin:0,df_copi: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,dst_path:0,dta:0,each:0,effect:0,either:0,element:0,empti:0,encod:0,enrich:0,error:0,etc:0,even:0,extra:0,fals:0,field:0,file:0,file_encod:0,file_label:0,file_path:0,filename_path:0,first:0,follow:0,format:0,formats_as_categori:0,found:0,frame:0,from:0,full:0,gener:0,get:0,given:0,guess:0,has:0,have:0,help:0,here:0,higher:0,iconv:0,ignor:0,independ:0,index:0,inform:0,instead:0,integ:0,interpret:0,its:0,kei:0,keyword:0,kwarg:0,label:0,later:0,left:0,length:0,limit:0,list:0,look:0,lower:0,mai:0,mani:0,map:0,match:0,max:0,maximum:0,mean:0,measur:0,member:0,metadataonli:0,miss:0,missing_rang:0,missing_user_valu:0,modul:0,more:0,must:0,name:0,nan:0,need:0,next:0,nomin:0,none:0,note:0,number:0,number_column:0,number_row:0,numer:0,offset:0,one:0,ones:0,onli:0,open:0,option:0,order:0,ordin:0,origin:0,original_variable_typ:0,other:0,otherwis:0,overcom:0,overflow:0,page:0,panda:0,paramet:0,pars:0,pass:0,path:0,per:0,piec:0,popul:0,por:0,present:0,purpos:0,python:0,rang:0,read:0,read_dta:0,read_file_in_chunk:0,read_funct:0,read_por:0,read_sas7bcat:0,read_sas7bdat:0,read_sav:0,read_xport:0,readabl:0,remain:0,replac:0,report:0,repres:0,result:0,right:0,rise:0,row:0,row_limit:0,row_offset:0,same:0,sas7bcat:0,sas7bdat:0,sas_datafram:0,sas_metadata:0,sata:0,sav:0,scale:0,search:0,section:0,sensit:0,set:0,set_catalog_to_sa:0,set_value_label:0,singl:0,situat:0,size:0,skip:0,some: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,thei:0,them:0,therefor:0,thi:0,those:0,time:0,transform:0,two:0,type:0,unalt:0,unchang:0,unknown:0,unless:0,unlimit:0,upper:0,use:0,usecol:0,used:0,user:0,user_miss:0,using:0,utf:0,valid:0,valu:0,value_label:0,variabl:0,variable_align:0,variable_display_width:0,variable_measur:0,variable_storage_width:0,variable_to_label:0,variable_value_label:0,variables_value_label:0,version:0,were:0,when:0,where:0,which:0,whole:0,whose:0,width: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,zsav:0},titles:["Welcome to pyreadstat\u2019s documentation!"],titleterms:{"function":0,descript:0,document:0,indic:0,metadata:0,object:0,pyreadstat:0,tabl:0,welcom:0}}) \ No newline at end of file +Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst"],objects:{"pyreadstat.pyreadstat":{read_dta:[0,1,1,""],read_file_in_chunks:[0,1,1,""],read_por:[0,1,1,""],read_sas7bcat:[0,1,1,""],read_sas7bdat:[0,1,1,""],read_sav:[0,1,1,""],read_xport:[0,1,1,""],set_catalog_to_sas:[0,1,1,""],set_value_labels:[0,1,1,""],write_dta:[0,1,1,""],write_por:[0,1,1,""],write_sav:[0,1,1,""],write_xport:[0,1,1,""]},pyreadstat:{pyreadstat:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"boolean":0,"case":0,"default":0,"import":0,"int":0,"return":0,"true":0,For:0,SAS:0,That:0,The:0,There:0,Use:0,Will:0,abl:0,about:0,accept:0,accord:0,account:0,add:0,added:0,addit:0,after:0,align:0,all:0,allow:0,also:0,alwai:0,ani:0,annot:0,anyth:0,appear:0,appli:0,applic:0,apply_value_format:0,apply_value_formta:[],appropi:0,appropri:0,argument:0,assum:0,attach:0,attempt:0,behavior:0,being:0,between:0,beyond:0,bool:0,both:0,boundari:0,can:0,cannot:0,catalog:0,catalog_fil:0,catalog_metadata:0,categori:0,center:0,certain:0,chang:0,charact:0,chunk:0,chunksiz:0,column:0,column_label:0,column_nam:0,column_names_to_label:0,combin:0,come:0,compat:0,compress:0,consid:0,contain:0,convers:0,convert:0,copi:0,correct:0,could: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,defin:0,deliv:0,describ:0,determin:0,df_copi: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,dst_path:0,dta:0,each:0,effect:0,either:0,element:0,empti:0,encod:0,enrich:0,error:0,etc:0,even:0,extra:0,fals:0,field:0,file:0,file_encod:0,file_label:0,file_path:0,filename_path:0,first:0,follow:0,format:0,formats_as_categori:0,found:0,frame:0,from:0,full:0,gener:0,get:0,given:0,guess:0,has:0,have:0,help:0,here:0,higher:0,iconv:0,ignor:0,independ:0,index:0,inform:0,instead:0,integ:0,interpret:0,its:0,kei:0,keyword:0,kwarg:0,label:0,later:0,left:0,length:0,limit:0,list:0,look:0,lower:0,mai:0,mani:0,map:0,match:0,max:0,maximum:0,mean:0,measur:0,member:0,metadataonli:0,miss:0,missing_rang:0,missing_user_valu:0,modul:0,more:0,must:0,name:0,nan:0,need:0,next:0,nomin:0,none:0,note:0,number:0,number_column:0,number_row:0,numer:0,offset:0,one:0,ones:0,onli:0,open:0,option:0,order:0,ordin:0,origin:0,original_variable_typ:0,other:0,otherwis:0,overcom:0,overflow:0,page:0,panda:0,paramet:0,pars:0,pass:0,path:0,per:0,piec:0,popul:0,por:0,present:0,purpos:0,python:0,rang:0,read:0,read_dta:0,read_file_in_chunk:0,read_funct:0,read_por:0,read_sas7bcat:0,read_sas7bdat:0,read_sav:0,read_xport:0,readabl:0,remain:0,replac:0,report:0,repres:0,result:0,right:0,rise:0,row:0,row_limit:0,row_offset:0,same:0,sas7bcat:0,sas7bdat:0,sas_datafram:0,sas_metadata:0,sata:0,sav:0,scale:0,search:0,section:0,sensit:0,set:0,set_catalog_to_sa:0,set_value_label:0,singl:0,situat:0,size:0,skip:0,some: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,thei:0,them:0,therefor:0,thi:0,those:0,time:0,transform:0,two:0,type:0,unalt:0,unchang:0,unknown:0,unless:0,unlimit:0,upper:0,use:0,usecol:0,used:0,user:0,user_miss:0,using:0,utf:0,valid:0,valu:0,value_label:0,variabl:0,variable_align:0,variable_display_width:0,variable_measur:0,variable_storage_width:0,variable_to_label:0,variable_value_label:0,variables_value_label:0,version:0,were:0,when:0,where:0,which:0,whole:0,whose:0,width: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,zsav:0},titles:["Welcome to pyreadstat\u2019s documentation!"],titleterms:{"function":0,descript:0,document:0,indic:0,metadata:0,object:0,pyreadstat:0,tabl:0,welcom:0}}) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 49c723e..bbaba28 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,13 +20,13 @@ # -- Project information ----------------------------------------------------- project = 'pyreadstat' -copyright = '2018, Otto Fajardo' +copyright = '2018-2020, Otto Fajardo' author = 'Otto Fajardo' # The short X.Y version version = '' # The full version, including alpha/beta/rc tags -release = '0.3.3' +release = '0.3.4' # -- General configuration --------------------------------------------------- diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index 920f6fa..f0e50c7 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -20,4 +20,4 @@ from .pyreadstat import read_file_in_chunks from ._readstat_parser import ReadstatError, metadata_container -__version__ = "0.3.3" +__version__ = "0.3.4" diff --git a/setup.py b/setup.py index 68b59e8..28ccc93 100644 --- a/setup.py +++ b/setup.py @@ -136,7 +136,7 @@ setup( name='pyreadstat', - version='0.3.3', + version='0.3.4', description=short_description, author="Otto Fajardo", author_email="pleasecontactviagithub@notvalid.com", diff --git a/src/sas/readstat_sas_rle.c b/src/sas/readstat_sas_rle.c index 3fc7afc..354da34 100644 --- a/src/sas/readstat_sas_rle.c +++ b/src/sas/readstat_sas_rle.c @@ -19,6 +19,9 @@ #define SAS_RLE_COMMAND_INSERT_BLANK2 14 #define SAS_RLE_COMMAND_INSERT_ZERO2 15 +#define MAX_INSERT_RUN 4112 // 4095 + 17 +#define MAX_COPY_RUN 4159 // 4095 + 64 + static size_t command_lengths[16] = { [SAS_RLE_COMMAND_COPY64] = 1, [SAS_RLE_COMMAND_INSERT_BYTE18] = 2, @@ -122,7 +125,12 @@ ssize_t sas_rle_decompress(void *output_buf, size_t output_len, } static size_t sas_rle_measure_copy_run(size_t copy_run) { - return (copy_run > 64) + (copy_run > 0) + copy_run; + size_t len = 0; + while (copy_run >= MAX_COPY_RUN) { + len += 2 + MAX_COPY_RUN; + copy_run -= MAX_COPY_RUN; + } + return len + (copy_run > 64) + (copy_run > 0) + copy_run; } static size_t sas_rle_copy_run(unsigned char *output_buf, size_t offset, @@ -131,6 +139,15 @@ static size_t sas_rle_copy_run(unsigned char *output_buf, size_t offset, if (output_buf == NULL) return sas_rle_measure_copy_run(copy_run); + while (copy_run >= MAX_COPY_RUN) { + *out++ = (SAS_RLE_COMMAND_COPY64 << 4) + 0x0F; + *out++ = 0xFF; + memcpy(out, copy, MAX_COPY_RUN); + out += MAX_COPY_RUN; + copy += MAX_COPY_RUN; + copy_run -= MAX_COPY_RUN; + } + if (copy_run > 64) { int length = (copy_run - 64) / 256; unsigned char rem = (copy_run - 64) % 256; @@ -229,7 +246,7 @@ ssize_t sas_rle_compress(void *output_buf, size_t output_len, unsigned char c = *p; if (insert_run == 0) { insert_run = 1; - } else if (c == last_byte) { + } else if (c == last_byte && insert_run < MAX_INSERT_RUN) { insert_run++; } else { if (sas_rle_is_insert_run(last_byte, insert_run)) { diff --git a/src/sas/readstat_xport_write.c b/src/sas/readstat_xport_write.c index 240ccc1..5265fce 100644 --- a/src/sas/readstat_xport_write.c +++ b/src/sas/readstat_xport_write.c @@ -12,10 +12,12 @@ #define XPORT_DEFAULT_VERISON 8 #define RECORD_LEN 80 -static void copypad(char *dst, size_t dst_len, const char *src) { - strncpy(dst, src, dst_len); - if (strlen(src) < dst_len) - memset(&dst[strlen(src)], ' ', dst_len-strlen(src)); +static void copypad(char * restrict dst, size_t dst_len, const char * restrict src) { + char *dst_end = dst + dst_len; + while (dst < dst_end && *src) + *dst++ = *src++; + while (dst < dst_end) + *dst++ = ' '; } static readstat_error_t xport_write_bytes(readstat_writer_t *writer, const void *bytes, size_t len) { diff --git a/src/spss/readstat_sav.c b/src/spss/readstat_sav.c index 66f47ea..18a5916 100644 --- a/src/spss/readstat_sav.c +++ b/src/spss/readstat_sav.c @@ -25,6 +25,15 @@ sav_ctx_t *sav_ctx_init(sav_file_header_record_t *header, readstat_io_t *io) { if (ctx == NULL) { return NULL; } + + if (memcmp(&header->rec_type, "$FL2", 4) == 0) { + ctx->format_version = 2; + } else if (memcmp(&header->rec_type, "$FL3", 4) == 0) { + ctx->format_version = 3; + } else { + sav_ctx_free(ctx); + return NULL; + } ctx->bswap = !(header->layout_code == 2 || header->layout_code == 3); ctx->endianness = (machine_is_little_endian() ^ ctx->bswap) ? READSTAT_ENDIAN_LITTLE : READSTAT_ENDIAN_BIG; @@ -42,7 +51,6 @@ sav_ctx_t *sav_ctx_init(sav_file_header_record_t *header, readstat_io_t *io) { ctx->highest_double = SAV_HIGHEST_DOUBLE; ctx->bias = ctx->bswap ? byteswap_double(header->bias) : header->bias; - ctx->format_version = header->rec_type[3] == '3' ? 3 : 2; ctx->varinfo_capacity = SAV_VARINFO_INITIAL_CAPACITY; From d3c3df878d73cfd94181a9fcbd418d4ffd2cc8f5 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Wed, 20 May 2020 16:31:44 +0200 Subject: [PATCH 6/6] updated Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d6d9e1..d79a8fb 100644 --- a/README.md +++ b/README.md @@ -736,7 +736,7 @@ pull request to ReadStat first. [Matthew Brett](http://matthew.dynevor.org/) - contributor [python wheels](/~https://github.com/MacPython/pyreadstat-wheels) -[Jonathon Love](https://jona.thon.love/) - contributor: open files with international characters. +[Jonathon Love](https://jona.thon.love/) - contributor: open files with international characters. Function to open files for writing. [Clemens Brunner](/~https://github.com/cbrnr) - integration with pandas.read_spss