+
    eim  c                   s    R t ^ RIt^ RIt^ RIHt ^ RIHtHt ^ RIt^ RI	t
^ RIHt ^ RIHtHtHt R t]P$                  P'                  R. RO4      R 4       t]P*                  R	 4       t]P$                  P'                  R
. RO4      R 4       tR tR tR tR tR t]P$                  P'                  RR4      R 4       t]P$                  P'                  RR4      R 4       t]P$                  P'                  RRR.4      R 4       t]P$                  P'                  R. RO4      R 4       t ]P$                  P'                  RR4      R 4       t!R t"]P$                  P'                  R]#]$34      R 4       t%]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      ]P$                  P'                  R]
PR                  ! R4      ]
PR                  ! R 4      34      R! 4       4       t*R" t+R# t,R$ t-R% t.R& t/]P$                  P'                  R'. RO4      ]P$                  P'                  R(. RO4      R) 4       4       t0R* t1R+ t2R, t3R- t4]P$                  P'                  RR.4      R/ 4       t5]P$                  P'                  RR0]
PR                  ! R14      3R2]
PR                  ! R34      3.4      R4 4       t6R5 t7R6 t8]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      ]P$                  P'                  R]
Pr                  R7,          4      ]P$                  Pu                  R84      R9 4       4       4       t;]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      ]P$                  P'                  R]
Pr                  R7,          4      ]P$                  Pu                  R84      R: 4       4       4       t<]P$                  P'                  R]
Pz                  ]
P|                  34      ]P$                  P'                  R;R4      R> 4       4       t?R? t@R@ tARA tB]P$                  PM                  ]'       * RBR7      RC 4       tC]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      RD 4       tD]P$                  P'                  RE^ ]#.RF34      RG 4       tE]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      RH 4       tF]P$                  P'                  RIR4      RJ 4       tGRK tH]P$                  P'                  RLR4      RM 4       tI]P$                  P'                  RLR4      RN 4       tJRO tK]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      RP 4       tLRQ tMRR tNRS tORT tPRU tQ]P$                  P'                  RVR4      ]P$                  P'                  RWR4      ]P$                  P'                  RXRR.4      RY 4       4       4       tR]P$                  P'                  R
R4      RZ 4       tS]P$                  P'                  RR[.RRRRRRRRRRR\]T! R4      3RR]]T! R4      3R.4      ]P$                  P'                  R^R=R<.4      R_ 4       4       tU]P$                  P'                  R]
Pr                  R7,          R`,           Ra,           4      Rb 4       tV]P$                  P'                  RRc4      Rd 4       tW]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      ]P$                  P'                  RRc4      ]P$                  P'                  Re. RO4      Rf 4       4       4       tX]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      ]P$                  P'                  R]
Pr                  R7,          Rg,           Ra,           4      Rh 4       4       tY]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      ]P$                  P'                  R]
Pr                  R7,          Rg,           Ra,           4      Ri 4       4       tZ]P$                  P'                  RVRjRk.RjRl..4      Rm 4       t[]P$                  P'                  RVRjRn.RjRo.RjRp.RjRq..4      Rr 4       t\]P$                  P'                  Rs. RO4      Rt 4       t]Ru t^Rv t_ ! Rw Rx4      t`Ry taRz tbR{ tcR| td]P$                  P'                  RR4      R} 4       te]P$                  P'                  R~R4      R 4       tf]P$                  P'                  RRR.4      ]P$                  P'                  RR4      R 4       4       tgR th]P$                  PM                  ];'       d    ]PN                  PP                  R8*  RR7      R 4       tiR tj]P$                  Pu                  R4      R 4       tk]P$                  P'                  RR4      R 4       tl]P$                  P'                  RR4      R 4       tmR# )z
Tests specific to `np.loadtxt` added during the move of loadtxt to be backed
by C code.
These tests complement those found in `test_io.py`.
N)StringIO)NamedTemporaryFilemkstemp)assert_equal)HAS_REFCOUNTIS_PYPYassert_array_equalc                 s    \        R4      p \        P                  ! . RO. RO. RO. RO.4      p\        \        P                  ! V RR7      V4       R# )	z0Test that both 'e' and 'E' are parsed correctly.zE1.0e-1,2.0E1,3.0
4.0e-2,5.0E-1,6.0
7.0e-3,8.0E1,9.0
0.0e-4,1.0E-1,2.0,	delimiterN)皙?g      4@      @)g{Gz?      ?   )gy&1|?g      T@	   )    r
      )r    nparrayr   loadtxt)dataexpected     C/usr/lib64/python3.14/site-packages/numpy/lib/tests/test_loadtxt.pytest_scientific_notationr      sD     D xx	./;GH rzz$#6A    commentc                 s    R p\        VP                  RV 4      4      p\        P                  ! VRV R7      p\	        VRR.RR.RR	..4       R
# )z,# IGNORE
1.5, 2.5# ABC
3.0,4.0# XXX
5.5,6.0
#r   r	   comments      ?      @r         @      @      @N)r    replacer   r   r   )r   Zcontenttxta   &   r   test_comment_multiple_charsr'   #   sK    @G
7??30
1C


3#8Ac3Z#sc3Z89r   c                 s    \        R4      p \        P                  ! R\        P                  3R\        P                  3RR\        P
                  3.4      p\        P                  ! . ROVR7      pWV3# )zq
Fixture providing heterogeneous input data with a structured dtype, along
with the associated structured array.
zo1000;2.4;alpha;-34
2000;3.1;beta;29
3500;9.9;gamma;120
4090;8.1;delta;0
5001;4.4;epsilon;-99
6543;7.8;omega;-1
f0f1f3dtypef2ZS7)i  g333333@Zalphai)i  g@Zbetai   )i  g#@Zgammaix   )i  g333333 @Zdeltar   )i  g@Zepsiloni)i  g333333@Zomega)r    r   r,   uint16float64int8r   )r   r,   r         r   mixed_types_structuredr5   +   sp     "	D HH
			T2::.tRWWoNE xx	
 
H   r   skiprowsc                 s^    Vw  r#p\         P                  ! W#R V R7      p\        WTV R 4       R# );)r,   r	   r6   Nr   r   r   )r6   r5   r   r,   r   r%   s   &&    r   1test_structured_dtype_and_skiprows_no_empty_linesr9   L   s/     3D


4hGAq89-.r   c                 s    V w  rp\         P                  ! WR RR7      w  rErg\        WCR,          4       \        WSR,          4       \        WcR,          4       \        WsR,          4       R# )r7   T)r,   r	   Zunpackr(   r)   r.   r*   Nr8   )r5   r   r,   r   r%   bZcZd   &       r   test_unpack_structuredr<   T   sR    2DDTJJA!q4.)q4.)q4.)q4.)r   c                  s    \         P                  ! RR.4      p \        R4      p\         P                  ! RR	.V R7      p\	        \         P
                  ! VRV R7      V4       R# )
r%   z0,1,2,3
6,7,8,9
r+   r   r	   r,   N)r%   u1r   )r:   r>   r   r      r      ))r      )   r   r   r,   r    r   r   r   r,   r   r   r4   r    test_structured_dtype_with_shaperH   ^   sN    HHnn56E()Dxx)+;<EJHrzz$#UCXNr   c                  s    \         P                  ! R.4      p \        R4      p\         P                  ! R.V R7      p\	        \         P
                  ! WR7      V4       R# )r%   z0 1 2 3
r+   N)r%   r>   )r   r   )r?   rF   rG   r4   r   &test_structured_dtype_with_multi_shaperI   e   sE    HH)*+EK Dxx,-U;Hrzz$4h?r   c                  s.   \         P                  ! R \        3R\        3.4      p \         P                  ! R\        3RV R	3.4      p\	        R4      p\         P
                  ! ^dR
R.3^RR.3.VR7      p\        \         P                  ! W!RR7      V4       R# )xZycodeZpointsz100,1,2,3,4
200,5,6,7,8
r+   r   r,   r	   N)r   )      ?       @)r   r    )      @r"   )g      @g       @)r   r,   floatintr    r   r   r   )Zpointdtr   r          r   test_nested_structured_subarrayrT   l   s    HHsElS%L12E	FC=8UD"9:	;B01Dxx8X&'8X&'	
 H rzz$C@(Kr   c                  s    \         P                  ! R RR7      p \        R4      p\         P                  ! RR	.V R7      p\	        \         P
                  ! VRV R7      V4       R# )
zi1, i4, i1, i4, i1, i4TZalignz1,2,3,4,5,6
7,8,9,10,11,12
r+   r   r=   N)rA   r   rC         r   )rD   rE   r   
   i   i   rF   )rR   r   r   r4   r   test_structured_dtype_offsetsrY   {   sL    	*$	7B34Dxx+-BC2NHrzz$#R@(Kr   paramc                s    \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! R/ V R/B  RRR4       R#   + '       g   i     R# ; i)z;skiprows and max_rows should raise for negative parameters.zargument must be nonnegativeZmatchNfoo.barpytestraises
ValueErrorr   r   rZ      &r   "test_exception_negative_row_limitsre      s9     
z)G	H	H


,, 
I	H	H	H   AA	c                 s    \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! R/ V R/B  RRR4       R#   + '       g   i     R# ; i)zargument must be an integerr[   rM   Nr\   r`   ra   	TypeErrorr   r   rc   rd   r   $test_exception_noninteger_row_limitsri      s7    	y(E	F	F


-- 
G	F	F	Frf   zdata, shapec                 s   \         P                  ! . RO4      pVP                  V4      p\        \         P                  ! \        V 4      \        R7      V4       \        \         P                  ! \        V 4      \        ^ R7      V4       \        \         P                  ! \        V 4      \        ^R7      V4       \        \         P                  ! \        V 4      \        ^R7      V4       R# )rA   r+   )r,   ndminN)rA   r   rC   rV   rW   )r   r   Zreshaper   r   r    rQ   )r   shapeZarrZarr2d   &&  r   test_ndmin_single_row_or_colrm      s     ((?
#CKKErzz(4.<cBrzz(4.1EsKrzz(4.1EsKrzz(4.1EuMr   badvalc                 s    \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! RV R7       RRR4       R#   + '       g   i     R# ; i)zIllegal value of ndmin keywordr[   r]   )rj   Nr_   )rn   rd   r   test_bad_ndminro      s2    	z)I	J	J


9F+ 
K	J	J	Jrf   wsc                 s    \        R V  RV  RV  RV  RV  R24      p\        P                  ! . R	O. R
O. RO. RO.4      p\        \        P                  ! V\
        RRR7      V4       R# )z1 2z30

z
4 5 60z
  z  
7 8 z 90
  # comment
3 2 1Nr   r,   r	   r   rA   r      rV   rW   i<   rD   rE   iZ   rC   r   rA   r    r   r   r   r   rQ   )rp   r$   r      &  r   test_blank_lines_spaces_delimitry      st     
bTt D d 	C xxZYGHH


3cTC@(r   c            	      s    \        R 4      p \        P                  ! . RO. RO. RO. RO.4      p\        \        P                  ! V \
        RRR7      V4       R# )	z&1,2,30

4,5,60

7,8,90
# comment
3,2,1r   r   rq   Nrr   rt   ru   rv   rw   )r$   r   r   r   !test_blank_lines_normal_delimiterrz      s@    
A
BCxxZYGHH


3cS3?r   r,   c                 s    \        R 4      p\        P                  ! WR^R7      p\        VP                  V 4       \        V\        P
                  ! RR.RR..V R7      4       R# )	z1.5,2.5
3.0,4.0
5.5,6.0r   r,   r	   max_rowsz1.5z2.5z3.0z4.0r+   N)r    r   r   r   r,   r   r,   r$   resrx   r   test_maxrows_no_blank_linesr      sO    
.
/C
**Sq
ACE"bhh?uMNr   zPyPy bug in error formatting)ZreasonZf8i2c                 s    \        R 4      pRV  R2p\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WRR7       RRR4       R#   + '       g   i     R# ; i)z1,2
3,XXX
5,6z"could not convert string 'XXX' to z at row 1, column 2r[   r   rL   Nr    r`   ra   rb   r   r   )r,   r$   msgrx   r   !test_exception_message_bad_valuesr      sL     $
%C.ug5H
IC	z	-	-


3s3 
.	-	-	-s   AA*	c                  s    \        R 4      p R
R /p\        P                  ! RR.R\        P                  .RR..4      p\        P                  ! V \        P
                  RVR7      p\        W24       R	# )z1.5,2.5
3.0,XXX
5.5,6.0c                 F    V R 8X  d   \         P                  # \        V 4      # ZXXXr   nanrP   srd   r   <lambda>Z2test_converters_negative_indices.<locals>.<lambda>       AJ"&&<E!H<r   r   r   r   r!   r"   r   r,   r	   
convertersNr0   )r    r   r   r   r   r2   r   r$   convr   r~   rS   r    test_converters_negative_indicesr      s]    
.
/C<=Dxx#sc266]S#J?@H
**S

cd
KCr   c                  s`   \        R 4      p RR /p\        P                  ! RR.R\        P                  .RR..4      p\        P                  ! V \        P
                  RV^ R.R7      p\        W24       \        P                  ! \        R	4      R^ R.RR
 /R7      p\        V^ R.^ R..4       R# )z$1.5,2.5,3.5
3.0,4.0,XXX
5.5,6.0,7.5
c                 r   r   r   r   rd   r   r   ?test_converters_negative_indices_with_usecols.<locals>.<lambda>   r   r   r   g      @r   r!   g      @r   )r,   r	   r   usecolsz0,1,2
0,1,2,3,4c                 s    R# )rA   r0    )rJ   rd   r   r   r      s    r   )r	   r   r   Nr0   )r    r   r   r   r   r2   r   r   r   rS   r   -test_converters_negative_indices_with_usecolsr      s    
<
=C<=Dxx#sc266]S#J?@H
**jjBC  **X45W"|1EGCsaWq"g./r   c                  s    . ROp \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! V RR7       RRR4       R#   + '       g   i     R# ; i)1,2,3z2the number of columns changed from 3 to 4 at row 3r[   r   r   N)r   r   z4,3,2,1r_   )Zrows    r   test_ragged_errorr      sF    (D	zF
H 
H


43'
H 
H 
H 
Hs   AA	c            	      s   \        R 4      p \        P                  ! ^ ^ .^ ^ .^ ^ ..4      p\        P                  ! V \        R^ R.R7      p\        W!4       \        R4      p \        P                  ! \        RR7      ;_uu_ 4        \        P                  ! V \        R^ R.R7       RRR4       R#   + '       g   i     R# ; i)$0,0,XXX
0,XXX,0,XXX
0,XXX,XXX,0,XXX
r   r,   r	   r   z0,0,XXX
0
0,XXX,XXX,0,XXX
z/invalid column index -2 at row 2 with 1 columnsr[   N)	r    r   r   r   rP   r   r`   ra   rb   r$   r   r~   r4   r   test_ragged_usecolsr      s    
<
=Cxx!Q!Q!Q01H
**Sq"g
FC
2
3C	zG
I 
I 	

3esQGD
I 
I 
I 
Is   !B00C	c                  s    \        R 4      p \        P                  ! V \        P                  ! . 4      R. R7      pVP                  R8X  g   Q hVP                  \        P                  ! . 4      8X  g   Q hR# )r   r   r   N)rC   )r    r   r   r,   rk   r$   r~   r   r   test_empty_usecolsr     sU    
<
=C
**SR
HC9999$$$r   c1c2c                 sB   \        R V  RV R24      p\        P                  ! V\        P                  ! R4      RR7      p\        P                  ! R V  R2P                  R4      RV R2P                  R4      .\        P                  ! R4      R7      p\        W44       R	# )
za,z	,c,1.0
e,z,2.0,gU12r   rL   z,c,1.0ze,r+   N)r    r   r   r,   r   Zsplitr   )r   r   r$   r~   r      &&   r   test_large_unicode_charactersr     s     Rt:bT0
1C
**S3
?CxxbT		s	#r"V_%:%:3%?@hhuoH r   c                  s    \        R 4      p ^ R /p\        P                  ! V \        P                  ! R4      VRRR7      p\        P                  ! RR.RR	.R
R..4      p\        W#4       R# )u   cat,dog
αβγ,δεζ
abc,def
c                 "    V P                  4       # Nupperr   rd   r   r   Z-test_unicode_with_converter.<locals>.<lambda>!  s
    r   r   r   Nr,   r   r	   encodingZCATZdogu   ΑΒΓu   δεζABCZdef)r    r   r   r,   r   r   r$   r   r~   r   rS   r   test_unicode_with_converterr     si    
6
7C"#D
**hhuoC xx%(H)=u~NOHr   c                  s   \        R 4      p \        P                  ! R\        P                  3R\        P                  3R	.4      p^ R R
R /p\        P
                  ! WRVR7      p\        P                  ! . ROVR7      p\        W44       R# )z$1.5,2.5,Abc
3.0,4.0,dEf
5.5,6.0,ghI
ZmZrc                 s8    \        ^
\        V 4      ,          4      # )rX   )rQ   rP   r   rd   r   r   6test_converter_with_structured_dtype.<locals>.<lambda>0  s    R%(]+r   c                 r   r   r   r   rd   r   r   r   0  s
    1779r   r   r   r+   N)rK   U8r0   ))i   r   r   )rs   r    DEF)i7   r"   ZGHI)r    r   r,   Zint32float32r   r   r   )r$   rR   r   r~   r           r   $test_converter_with_structured_dtyper   -  sr    
<
=C	C?S"**$5~F	GB+R1DED
**Scd
CCxx>bH r   c                 s    \        R4      p \        P                  p\        P                  ! V \        P
                  ! R4      VRRR7      p\        P                  ! RR.RR	..4      p\        W#4       R
# )a,  
With the 'bytes' encoding, tokens are encoded prior to being
passed to the converter. This means that the output of the converter may
be bytes instead of unicode as expected by `read_rows`.

This test checks that outputs from the above scenario are properly decoded
prior to parsing by `read_rows`.
zabc,def
rst,xyzZU3r   bytesr   r   r   ZRSTZXYZN)r    r   r   r   r   r,   r   r   r   rS   r   !test_converter_with_unicode_dtyper   8  s_     %
&C;;D
**rxx~$#C xx%%89Hr   c                  s    R R,          p V RR R,           p \        V ^,          4      p\        P                  ! VR\        R7      p\	        V\        P
                  ! RR.R	4      4       R# )
z	1.5, 2.5,P  N
r   r=   r   r   r0   )r   r   )r    r   r   rP   r   Ztile)rowr$   r~   r4   r   test_read_huge_rowr   J  sT    

C
cr(T/C
37
C
**SCu
5CbggsCj*56r   ZedfgFDGc                 s    Rp\         P                  ! V 4      p \         P                  ! V.V R7      R,          pW P                  R4      8X  g   Q hR# )Z0r+   z0.123456789Na  0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.123456789r   )r   r,   r   type)r,   fieldvaluerx   r   test_huge_floatr   R  sB     &EHHUOEJJwe,R0EJJ}----r   ZSS5UZU5c                s    \        R4      p\        P                  ! W RR7      p\        P                  ! RR.RR.RR	..VR
7      p\	        W44       \	        VP
                  V4       R# )z
The given dtype is just 'S' or 'U' with no length. In these cases, the
length of the resulting dtype is determined by the longest string found
in the file.
zAAA,5-1
BBBBB,0-3
C,4-9
r   rL   ZAAAz5-1ZBBBBBz0-3ZCz4-9r+   N)r    r   r   r   r   r,   )given_dtypeexpected_dtyper$   r~   r   r   r   test_string_no_length_givenr   [  s^     0
1C
**Ss
;Cxx
'5)C<8H N+r   c                 s    . ROp \        RP                  V 4      4      p\        P                  ! V4      p\        P                  ! V  Uu. uF  p\        V4      NK  	  up4      p\        W$4       R# u upi )z
Some tests that the conversion to float64 works as accurately as the
Python built-in `float` function. In a naive version of the float parser,
these strings resulted in values that were off by an ULP or two.
r   N)z0.9999999999999999z9876543210.123456z5.43215432154321e+300z0.901z0.333)r    joinr   r   r   rP   r   )Zstringsr$   r~   r   r   r   r   test_float_conversionr   q  sY    G 499W%
&C
**S/Cxx737aq734H 4s   	A1c                  s   \        R 4      p \        P                  ! V \        RR7      pVP                  \        8X  g   Q h\        VRR.RR..4       \        VP                  \        P                  4      ^^ .^^..4       R# )z1, 0
10, -1r   rL   TFN)r    r   r   Zboolr,   r   ZviewZuint8r   r   r   	test_boolr     sk    
>
"C
**S
4C99sdE]T4L9:sxx)QFQF+;<r   Z
AllIntegerz0error:.*integer via a float.*:DeprecationWarningc                 sL   \         P                  ! V 4      p \         P                  ! R .V R7      ^8X  g   Q hV P                  R8X  dF   \        P
                  ! \        4      ;_uu_ 4        \         P                  ! R.V R7       RRR4       M \         P                  ! R.V R7      R8X  g   Q hR FJ  p\        P
                  ! \        4      ;_uu_ 4        \         P                  ! V R2.V R7       RRR4       KL  	  R#   + '       g   i     Lb; i  + '       g   i     Kt  ; i)	z+2r+   Zuz-1
Nz-2
z2
r   )z++z+-z--z-+)r   r,   r   Zkindr`   ra   rb   )r,   Zsign   & r   test_integer_signsr     s    
 HHUOE::tfE*a///zzS]]:&&JJxu- '& zz6(%0B666(]]:&&JJ4&~U3 '& ) '& '&&s   *C?D?D	D#c                 s    \        R 4      p\        P                  ! \        4      ;_uu_ 4        \        P
                  ! WRR7       RRR4       R#   + '       g   i     R# ; i)z1.0, 2.1, 3.7
4, 5, 6r   rL   Nr   )r,   r$   r   r   %test_implicit_cast_float_to_int_failsr     s;    
 +
,C	z	"	"


3s3 
#	"	"	"   AA"	with_parensFTc                 s    R pV'       g#   VP                  RR4      P                  RR4      p\        P                  ! \        V4      V RR7      p\        P                  ! . RO. R	O.V R7      p\        W44       R# )
z*(1.0-2.5j),3.75,(7+-5.0j)
(4),(-19e2j),(0)Z( Z)r   rL   r+   N)y      ?      g      @y      @      )r    y            r   )r#   r   r   r    r   r   )r,   r   r   r~   r   r   r   test_complex_parsingr     sb     	6AIIc2&&sB/
**Xa[
=Cxx	#%56eH r   c                  s    R  p \         P                  ! V ! 4       \        RR7      p\         P                  ! . RO. RO. RO. RO.4      p\	        W4       R# )c               3   sf   "   \        ^4       F  p V  R^V ,           RV ^,           2x  K  	  R# 5i)rV   r   Nrangeir   r   genZ%test_read_from_generator.<locals>.gen  s2     qACqQqA'' s   /1r   rL   N)r   r   r   )rA   r   rA   )r   rV   rV   )rC   r   r   )r   r   rQ   r   r   r   r~   r   r4   r   test_read_from_generatorr     s<    ( **SU#
5CxxIy)DEHr   c                  s    R  p \         P                  ! V ! 4       RRR7      p\         P                  ! . RORR7      p\        W4       R# )c               3   sR   "   \        ^4       F  p V  RV ^,           2x  K  	  R# 5i)rC    Nr   r   r   r   r   Z/test_read_from_generator_multitype.<locals>.gen  s'     qACqQ.  s   %'zi, dr   rL   r+   N))r   g        )rA   g      ?)r   r   )r   r   r   r   r   r4   r   "test_read_from_generator_multityper     s6    ! **SU&C
8Cxx7vFHr   c                  s    R  p \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! V ! 4       RRR7       RRR4       R#   + '       g   i     R# ; i)c               3   s*   "   . RO Rj  xL
  R#  L5i)1,2N)r   s   3, 5i1  r   r   r   r   r   Z)test_read_from_bad_generator.<locals>.gen  s     ***s   &non-string returned while reading datar[   zi, ir   rL   Nrg   )r   r   r   test_read_from_bad_generatorr     sM    + 
F
H 
H


35#6
H 
H 
H 
Hs   AA"	zPython lacks refcountsc                  sL  aa \        4       o^ oVV3R lp \        RR,          4      p\        P                  ! \        RR7      ;_uu_ 4        \
        P                  ! V\         ^ V /R7       RRR4       \        P                  ! S4      ^8X  g   Q hR#   + '       g   i     L/; i)r   c                 s>   < SR 8  d   \        R4      hS^,          oS# )i  zfailed half-way through!)rb   )rJ   already_readsentinels   &r   r   Z/test_object_cleanup_on_read_error.<locals>.conv  s&    $788r   zx
'  zat row 5000, column 1r[   r,   r   N)	objectr    r`   ra   rb   r   r   sysZgetrefcount)r   r$   r   r   s     @@r   !test_object_cleanup_on_read_errorr     ss    xHL 55=
!C	z)@	A	A


3f!T; 
B ??8$))) 
B	As    BB#	c                 s    \        R4      p \        P                  ! \        4      ;_uu_ 4        \        P
                  ! V RR7       RRR4       R#   + '       g   i     R# ; i)z9Test exception when a character cannot be encoded as 'S'.u   –r   r+   Nr   )r   r   r   #test_character_not_bytes_compatibler     s9     E?D	z	"	"


4t$ 
#	"	"	"r   r   r   c                 s    R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! \        R4      V R7       RRR4       R#   + '       g   i     R# ; i)z\converters must be a dictionary mapping columns to converter functions or a single callable.r[   1 2
3 4r   Nr`   ra   rh   r   r   r    )r   r   r   r   test_invalid_converterr     sA    	*  
y	,	,


8J'D9 
-	,	,	,s   "AA$	c                  s   \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      R\        /R7       RRR4       \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      R\        /^ R7       RRR4       R#   + '       g   i     Lg; i  + '       g   i     R# ; i)zkeys of the converters dictr[   r   r%   r   N)r   r   )r`   ra   rh   r   r   r    rQ   r   r   r   +test_converters_dict_raises_non_integer_keyr     s{     
y(E	F	F


8J'S#J? 
G	y(E	F	F


8J'S#JJ 
G	F 
G	F	F	F	Fs   (B,9)B?,B<	?C	bad_col_indc                 s    \        R 4      p\        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! W\        /R7       RRR4       R#   + '       g   i     R# ; i)r   zconverter specified for columnr[   r   N)r    r`   ra   rb   r   r   rQ   )r   r   r   r   'test_converters_dict_raises_non_col_keyr     s?    JD	z)I	J	J


4#$67 
K	J	J	Js   AA)	c                  s    \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      ^ ^/R7       RRR4       R#   + '       g   i     R# ; i)z4values of the converters dictionary must be callabler[   r   r   Nr   r   r   r   ,test_converters_dict_raises_val_not_callabler     sJ    	yL
N 
N


8J'QF;
N 
N 
N 
Ns   $AA$	qc                 s   \        V  R V  RV  RV  RV  RV  R24      p\        P                  ! RR\        P                  3.4      p\        P                  ! . ROVR7      p\        P
                  ! WRV R	7      p\        WC4       R
# )alpha, xz, 2.5
beta, yz, 4.5
gamma, zz, 5.0
r)   r+   r   r,   r	   	quotecharNr(   r   )r   r   )r   g      @)r   rO   r    r   r,   r2   r   r   r   r   r$   r,   r   r~      &    r   test_quoted_fieldr     s    
#XaSs'!GA3hqcIC HHlT2::$678Exx@H **S
BCs%r   c                 s   \        V  R V  RV  RV  RV  RV  R24      p\        P                  ! R
R\        P                  3.4      p\        P                  ! . ROVR7      p\        P
                  ! WRV R	7      p\        WC4       R# )r   z	     2.5
r   z 4.5
r   z   5.0
r)   r+   Nr   r   r   r   r   r   r   *test_quoted_field_with_whitepace_delimiterr     s    
#XaS
1#WQCvaS8LC HHlT2::$678Exx@H **S
CCs%r   c                 s   \        R4      p \        P                  ! RR\        P                  3R\        P                  3.4      p\        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! WRR7       RRR4       V P                  ^ 4       \        P                  ! R.VR	7      p\        P                  ! WRR
R7      p\        W24       R#   + '       g   i     L`; i)z1Support for quoted fields is disabled by default.z"lat,long", 45, 30
r)   r.   z.the dtype passed requires 3 columns but 4 werer[   r   rL   Nr+   "r   )r(   ZU24)zlat,longg     F@g      >@)r    r   r,   r2   r`   ra   rb   r   seekr   r   )r$   r,   r   r~   rS   r   test_quote_support_defaultr   -  s    
)
*CHHmdBJJ%7$

9KLME	zB
D 
D


3s3
D
 HHQKxx/0>H
**S
DCs%
D 
Ds   )CC*	c                  s    \        R 4      p Rp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! V RRR7       RRR4       R#   + '       g   i     R# ; i)1,2
3,4z,.*must be a single unicode character or Noner[   r   z''r	   r   Nr    r`   ra   rh   r   r   )r$   r   r   r   test_quotechar_multichar_errorr   >  sC     :
C
9C	y	,	,


3#6 
-	,	,	,s   AA'	c            	      s   \        R 4      p Rp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! V RRRR7       RRR4       \        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! V RRR	.RR7       RRR4       \        P
                  ! V RRR
R7      p\        V^^.^^..4       R#   + '       g   i     L; i  + '       g   i     LQ; i)r   zWwhen multiple comments or a multi-character comment is given, quotes are not supported.r[   r   Z123r   )r	   r   r   Nr   Z%')r   )r    r`   ra   rb   r   r   r   )r$   r   r~   r4   r   'test_comment_multichar_error_with_quoter   G  s    
:
C	$  
z	-	-


3#E 
.	z	-	-


3#c
cJ 
. **SC&C
HC1v1v&' 
.	-	-	-s   C9CC	C/	c                  s,   \        R 4      p \        P                  ! R\        P                  3R\        P                  3R	R\        P
                  3.4      p\        P                  ! . R
OVR7      p\        P                  ! WRRR7      p\        W24       R# )z{1000;2.4;'alpha';-34
2000;3.1;'beta';29
3500;9.9;'gamma';120
4090;8.1;'delta';0
5001;4.4;'epsilon';-99
6543;7.8;'omega';-1
r(   r)   r*   r+   r7   r   r   Nr-   r/   )	r    r   r,   r1   r2   r3   r   r   r   )r   r,   r   r~   rS   r   !test_structured_dtype_with_quotesr   W  s}    $	D HH
			T2::.tRWWoNE xx	
 
H **T#
ECs%r   c                      \        R 4      p \        P                  ! . RORR7      p\        P                  ! V RRRR7      p\	        W!4       R# )z	1

"4"
""U1r+   r   r   r	   r,   r   N14r   r    r   r   r   r   r   r4   r   test_quoted_field_is_not_emptyr  t  s8    
>
"Cxxd3H
**SCts
CCr   c                  r   )z1

"4"
"r   r+   r   r   r  Nr  r  r   r4   r   (test_quoted_field_is_not_empty_nonstrictr  z  s:     =
!Cxxd3H
**SCts
CCr   c                  s    \        R 4      p \        P                  ! RRR7      p\        P                  ! V RRRR7      p\	        W!4       R# )z"Hello, my name is ""Monty""!"zHello, my name is "Monty"!ZU40r+   r   r   r   Nr  r   r4   r   "test_consecutive_quotechar_escapedr    s:    
3
4Cxx4EBH
**S
DCr   r   rj   r   c           
     s   Ve   RpMV^8X  d   RpMR	p\        V 4      p\        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! WAVR7      pRRR4       XP                  V8X  g   Q h\        RR7      ;_uu_ 4       pVP                  V 4       VP                  ^ 4       \        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! WAVR7      pRRR4       VP                  V8X  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     LA; i  + '       g   i     R# ; i)
zDCheck that a UserWarning is emitted when no data is read from input.Ninput contained no datar[   )rj   r   w)Zmode)r   rC   r@   )r   )
r    r`   warnsUserWarningr   r   rk   r   writer   )r   rj   r   Zexpected_shaper$   r~   fhs   &&&    r   test_warn_on_no_datar    s    
 	!
4.C	k)B	C	Cjj7; 
D99&&&		%	%


\\+-FGG**Sw?C HyyN*** 
&	%	 
D	C HG 
&	%	%s1   DAD7D$	+D7D!	$D4/D77E	c                 s    R p\        V4      p\        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! W R7       RRR4       R#   + '       g   i     R# ; i)z1 2 3
4 5 6r	  r[   )r6   N)r    r`   r  r  r   r   )r6   r   r$   rx   r   test_warn_on_skipped_datar    s>    D
4.C	k)B	C	C


3* 
D	C	C	Cs   AA%	r   
complex128Zclongdoubleswapc                 sZ   \         P                  ! V 4      p R V R2.pV'       d   V P                  4       p \         P                  ! RRV 3.RR7      pVP                  R,          ^,          ^8X  g   Q h\         P                  ! W4R^R7      pVR,          V P                  V4      8X  g   Q hR# )	zx,r   r:   FrU   r   r{   N)r%   ZS1)r   r,   ZnewbyteorderZfieldsr   r   )r,   r   r  r   Zfull_dtr~   s   &&&   r   test_byteswapping_and_unalignedr    s    ( HHUOErND""$hhc5\2%@G>>#q!Q&&&
**TC!Cs8uzz%((((r   ZefdFDZ?c                 s    \        R 4      p\        P                  ! WRRR7      p\        V\        P                  ! ^^.4      P                  V 4      4       R# )u    3 ," 2
"r   r   r   N)r    r   r   r   r   astyper}   rx   r   !test_unicode_whitespace_strippingr    sC     $
%C
**S
DCsBHHaV,33E:;r   ZFDc                 s    R pWP                  RR4      .p\        P                  ! W RR7      p\        V\        P                  ! . RO.^,          4      4       R# )z0 1 , 2+3j , ( 4+5j ), ( 6+-7j )  , 8j , ( 9j ) 
r   u    r   rL   N)rA   y       @      @y      @      @y      @      y               @y              "@)r#   r   r   r   r   )r,   Zliner   r~   r&   r   )test_unicode_whitespace_stripping_complexr    sH     ?D,,sH-.D
**T#
6CsBHH&I%JQ%NOPr   r   c                 s    \         P                  ! \        4      ;_uu_ 4        \        P                  ! VR ,           .V RR7       RRR4       R#   + '       g   i     R# ; i)r   r   rL   Nr_   )r,   r      &&r   test_bad_complexr    s8     
z	"	"


EDL>#> 
#	"	"	"s   "AA 	ZefgdFDGc           	      s   V P                  4       R 8X  d   \        P                  ! R4       \        P                  ! \        4      ;_uu_ 4        \
        P                  ! R.V RRR7       RRR4       R#   + '       g   i     R# ; i)Zgz0longdouble/clongdouble assignment may misbehave.1 r   r   r   N)Zlowerr`   xfailra   rb   r   r   r+   rd   r   test_nul_character_errorr    sQ     {{}GH	z	"	"


G9ESCH 
#	"	"	"s   A44B	c                 s   V R 8X  d   \         P                  ! R4       V R9   d   \         P                  ! R4       \        R4      \	        R4      u;8X  d   \        R4      u;8X  d	   ^8X  g   Q h Q h\         P                  ! \        4      ;_uu_ 4        \        P                  ! R.V R7       RRR4       R#   + '       g   i     R# ; i)Zez5half assignment currently uses Python float converterZeGz2clongdouble assignment is buggy (uses `complex`?).Z1_1z1_1
r+   N)
r`   Zskipr  rQ   rP   Zcomplexra   rb   r   r   r+   rd   r   test_no_thousands_supportr    s     |KL}IJu:u==2=====	z	"	"


G9E* 
#	"	"	"s   B88C		z1,2
z2
,3
z2,3
c                 s    R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! V RR7       RRR4       R#   + '       g   i     R# ; i)z7Found an unquoted embedded newline within a single liner[   r   r   Nr_   )r   r   r   r   test_bad_newline_in_iteratorr    s8     DC	z	-	-


43' 
.	-	-	-s   A

A	z2,3
z'2
',3
z'2',3
z'2
',3
c                 s\    \         P                  ! V R RR7      p\        VRR.RR..4       R# )r   r   r   rM   rN   r   Nr8   )r   r~   r   r   test_good_newline_in_iteratorr    s-     **TSC
8Csb"XBx01r   newlinec                 s    . R
OpV Uu. uF  q"P                  RV 4      NK  	  pp\        P                  ! V\        RRR7      p\	        VRRV  2.RRV  R2..4       R	# u upi )1,"2
"
r   r   r   r   r  23r  N)r   z3,"4
z1"
)r#   r   r   r   r   )r  r   r   r~   r&   r   test_universal_newlines_quotedr#     sf    
 +D267$3KKg&$D7
**T3#
FCscQwi=1C1WIQ3HIJ 8s   Ac                  s    \         P                  ! R R.RR7      p \        V . R	O. R
O.4       \         P                  ! RR.R\        R7      p V P	                  4       . RO. RO.8X  g   Q hR# )z1 2 3
z4 5 6Z r   z1 ,2 ,3
z4 ,5 ,6r   r=   NrA   r   rC   )rV   rW   r   )r  z2 r"  )z4 z5 6)r   r   r   r   Ztolist)r~   r   r   test_null_characterr&  +  s^    
**o}5
HCsY	23 **'9"&2C::<35LMMMMr   c                  s     ! R  R4      p \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! V ! 4       \
        RR7       RRR4       R#   + '       g   i     R# ; i)c                   s,   a  ] tR tRt o R tR tRtV tR# ):test_iterator_fails_getting_next_line.<locals>.BadSequencei7  c                s    ^d# )id   r   selfrd   r   __len__ZBtest_iterator_fails_getting_next_line.<locals>.BadSequence.__len__8  s    r   c                sB    V^28X  d   \        R4      hV RV^,            2# )i2   Bad things happened!z, )RuntimeError)r)  Zitemr  r   __getitem__ZFtest_iterator_fails_getting_next_line.<locals>.BadSequence.__getitem__;  s*    rz"#9::V2dQhZ((r   r   N)__name__
__module____qualname____firstlineno__r*  r-  __static_attributes____classdictcell__Z__classdict__   @r   BadSequencer'  7  s     		) 	)r   r6  r+  r[   r   rL   N)r`   ra   r,  r   r   rQ   )r6  r   r   %test_iterator_fails_getting_next_liner7  6  sB    ) ) 
|+A	B	B


;=s; 
C	B	B	Bs   #AA-	c                   s   a  ] tR tRt o R tR tR tR tR tR t	]
P                  P                  R. RO4      R	 4       tR
tV tR# )TestCReaderUnitTestsiD  c                   \         P                  ! \        R R7      ;_uu_ 4        \        P                  P
                  P                  \        4       \        P                  ! R4      RR7       RRR4       R#   + '       g   i     R# ; i)z.*readr[   r   Tr,   filelikeN)	r`   ra   ZAttributeErrorr   _core_multiarray_umath_load_from_fileliker   r,   r(  rd   r   test_not_an_filelikeZ)TestCReaderUnitTests.test_not_an_filelikeG  sP    ]]>::HH&&:: ; > ;:::   A	A88B		c                &    ! R  R4      p\         P                  ! \        RR7      ;_uu_ 4        \        P                  P
                  P                  V! 4       \        P                  ! R4      RR7       RRR4       R#   + '       g   i     R# ; i)c                   *   a  ] tR tRt o ^ tR tRtV tR# )BTestCReaderUnitTests.test_filelike_read_fails.<locals>.BadFileLikeiP  c                sp    V ;P                   ^,          un         V P                   ^8  d   \        R4      hR# )rA   Bad bad bad!z1,2,3
)counterr,  r)  Zsizer  r   readZGTestCReaderUnitTests.test_filelike_read_fails.<locals>.BadFileLike.readS  s*    !<<"$&~66 r   r   Nr.  r/  r0  r1  rE  rG  r2  r3  r4  r5  r   BadFileLikerC  P  s     G! !r   rI  rD  r[   r   Tr:  N)r`   ra   r,  r   r<  r=  r>  r,   r)  rI  r   r   test_filelike_read_failsZ-TestCReaderUnitTests.test_filelike_read_failsL  s]    	! 	! ]]<~>>HH&&::RXXc]T ; C ?>>>   AA??B	c                rA  )c                   rB  )@TestCReaderUnitTests.test_filelike_bad_read.<locals>.BadFileLikeib  c                s    R # )i  r   rF  r  r   rG  ZETestCReaderUnitTests.test_filelike_bad_read.<locals>.BadFileLike.reade  s    r   r   NrH  r4  r5  r   rI  rM  b  s     G r   rI  r   r[   r   Tr:  N)r`   ra   rh   r   r<  r=  r>  r,   rJ  r   r   test_filelike_bad_readZ+TestCReaderUnitTests.test_filelike_bad_read]  sn    
	 	 ]]9BD DHH&&::RXXc]T ; CD D D DrL  c                r9  )z/error reading from object, expected an iterabler[   r   Fr:  N	r`   ra   rh   r   r<  r=  r>  r   r,   r(  rd   r   test_not_an_iterZ%TestCReaderUnitTests.test_not_an_iterm  sa    ]]9KM MHH&&:: ; ?M M M Mr@  c                s    \         P                  ! \        R R7      ;_uu_ 4        \        P                  P
                  P                  \        4       RRR7       RRR4       R#   + '       g   i     R# ; i)zinternal error: dtype mustr[   r   Fr:  N)r`   ra   rh   r   r<  r=  r>  r   r(  rd   r   test_bad_typeZ"TestCReaderUnitTests.test_bad_types  sJ    ]]9,HIIHH&&::e ; 5 JIIIs   5A$$A5	c           	     s   \         P                  ! \        R R7      ;_uu_ 4        \        P                  P
                  P                  \        4       \        P                  ! R4      R^{R7       RRR4       R#   + '       g   i     R# ; i)zencoding must be a unicoder[   r   F)r,   r;  r   NrO  r(  rd   r   test_bad_encodingZ&TestCReaderUnitTests.test_bad_encodingx  sU    ]]9,HIIHH&&:: ; M JIIIs   A
A99B
	r  c           	     s    \        R P                  RV4      RR7      p\        P                  P                  P                  V\        P                  ! R4      RRR^R7      p\        VR,          R	R
V 2RR.4       R# )z0
1
"2
"
3
4 #
r   r   )r  ZU10Tr   r   )r,   r;  Zquoter   Z	skiplinesr  r!  r"  z4 N:NNNr   )r    r#   r   r<  r=  r>  r,   r   )r)  r  r   r~   rl   r   test_manual_universal_newlinesZ3TestCReaderUnitTests.test_manual_universal_newlines}  sw     /77gF "$ hh((<<$sa = 1 	3t9sayM3&EFr   r   N)r   
)r.  r/  r0  r1  r?  rK  rN  rP  rQ  rR  r`   markparametrizerT  r2  r3  r4  r5  r   r8  r8  D  sN     >
C"C ?5
M
 [[Y(<=G >Gr   r8  c                      \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      RRR7       RRR4       R#   + '       g   i     R# ; i)".*control characters.*incompatibler[   1, 2, 3r   r   Nr   r   r   r   'test_delimiter_comment_collision_raisesr\    s9    	y(L	M	M


8I&#D 
N	M	M	M   #AA#	c                  rY  )rZ  r[   r[  r   r   Nr   r   r   r   )test_delimiter_quotechar_collision_raisesr^    s9    	y(L	M	M


8I&#E 
N	M	M	Mr]  c                  rY  )rZ  r[   1 2 3r   )r   r   Nr   r   r   r   'test_comment_quotechar_collision_raisesr`    s9    	y(L	M	M


8G$scB 
N	M	M	Mr]  c                  s    \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      RRR.R7       RRR4       R#   + '       g   i     R# ; i)z0Comment characters.*cannot include the delimiterr[   r[  r   r   r   Nr   r   r   r   5test_delimiter_and_multiple_comments_collision_raisesra    sI    	K
 
 	

8I&#c
K
 
 
 
s   %AA%	c                 s   \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        RV  RV  RV  RV  R2	4      V R7       RRR4       \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        RV  RV  RV  RV  R2	4      V R	7       RRR4       R#   + '       g   i     Lm; i  + '       g   i     R# ; i)
rZ  r[   r  r!  z3
45z6
r   Nr   r   )rp   rd   r   ,test_collision_with_default_delimiter_raisesre    s     
y(L	M	M


8at1RDRD"S9:RH 
N	y(L	M	M


8at1RDRD"S9:bI 
N	M 
N	M	M	M	Ms   /B9 /C9C		C	nlc                 sX   \        R V  RV  RV  V  RV  RV  RV  V  24      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WR7       R	R	R	4       \        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WR
7       R	R	R	4       \        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WR7       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     Li; i  + '       g   i     R	# ; i)r  r!  r"  r  rb  r%  z&control character.*cannot be a newliner[   r   Nrc  rd  r   )rf  r$   r   rx   r   %test_control_character_newline_raisesrg    s    
Qrd!B4qRD"Qrd!B4t<
=C
2C	y	,	,


3% 
-	y	,	,


3$ 
-	y	,	,


3% 
-	,	 
-	,	,	,	,	,	,s$   C2DD2D	D	D)	nrowsc           	     sJ   V .V,          V.,           p\         P                  ! WSR7      p\        V4      V^,           8X  g   Q h\        V4      \        V4      8X  g   Q h\        RP	                  V4      4      p\         P
                  ! WrR7      p\        V4      \        V4      8X  g   Q hVP                  VP                  8X  g   Q h\        W4       \        4       w  r\        P                  ! V	4       \        V
R4      ;_uu_ 4       pVP                  RP	                  V4      R,           4       RRR4       \         P
                  ! WR7      p\        V4      \        V4      8X  g   Q hVP                  VP                  8X  g   Q h\        W4       \         P
                  ! W\        V^,          4      R7      p\        P                  ! V
4       \        V4      \        V^,          4      8X  g   Q h\        WR\        V^,          4       4       R#   + '       g   i     L; i)z|Check that the correct unit (e.g. month, day, second) is discovered from
the data when a user specifies a unitless datetime.r+   r   r
  N)r,   r|   )r   r   lenr    r   r   r,   r   r   oscloseopenr  rQ   remove)generic_data
long_datumunitless_dtyper   rh  r   r   r$   r%   fdfnamer  s   &&&&&       r   test_parametric_unit_discoveryrs    s    >E!ZL0Dxx3Ht9	!!!t9H%%% 499T?
#C


3-Aq6S]"""77hnn$$$ 	IBHHRL	eS		R
44'( 
 	

5/Aq6S]"""77hnn$$$


5UQYHAIIeq6S^###_c%!)n-. 
	s   (HH"	c                  s   R .R,          R.,           p \         P                  ! R .R,          R.,           RR7      pR p\        RP                  V 4      4      p\         P                  ! VRVR	7      pVP
                  VP
                  8X  g   Q h\        WA4       \        4       w  rV\        P                  ! V4       \        VR
4      ;_uu_ 4       pVP                  RP                  V 4      4       RRR4       \         P                  ! VRVR	7      p\        P                  ! V4       VP
                  VP
                  8X  g   Q h\        WA4       R#   + '       g   i     Li; i)
spam-a-lot`  ZXXXtis_but_a_scratchtis_but_a_scratchU17r+   c                 s$    V P                  R 4      # r   )Zremoveprefixr   rd   r   r   Z>test_str_dtype_unit_discovery_with_converter.<locals>.<lambda>  s    Q^^E*r   r   r   r   r
  N)r   r   r    r   r   r,   r   r   rj  rk  rl  r  rm  )r   r   r   r$   r%   rq  rr  r  s           r   ,test_str_dtype_unit_discovery_with_converterrx    s   >E!%;$<<Dxx	"5!66eH +D 499T?
#C


3cd3A77hnn$$$ 	IBHHRL	eS		R
4! 



55AIIe77hnn$$$ 
	s   !EE!	c                  s   \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      RR7       RRR4       \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \        R4      RR7       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! \        R4      RR7       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! \        R4      R	R.R7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)
z#Text reading control character mustr[   r_  r   r   Nrd  z"comments cannot be an empty stringrc  r   )r`   ra   rh   r   r   r    rb   r   r   r   test_control_character_emptyry    s     
y(M	N	N


8G$3 
O	y(M	N	N


8G$3 
O	z)M	N	N


8G$r2 
O	z)M	N	N


8G$Ry9 
O	N 
O	N	N	N	N	N	N	N	Ns/   "D=3"E"E#$E6=E	E 	#E3	6F	c                 sf    \         P                  ! \        R4      RRR7      p \        V . RO4       R# )z<Byte control characters (comments, delimiter) are supported.z#header
1,2,3s   #s   ,)r   r	   Nr$  )r   r   r    r   )r%   r   r    test_control_characters_as_bytesrz    s$    


8,-MAIr   zignore::UserWarningc                  s
   \         P                  ! R .R\        R7      p \        V 4      ^ 8X  g   Q h\	        ^R4       FB  p\         P                  ! RV,          .R\        ^
R7      p \        V 4      V^,           8X  d   KB  Q h	  R# )r   r   r=   i   )r	   r,   r|   N)r   r   r   ri  r   )r~   r   r   r   test_field_growing_casesr{    sh     **bTS
6Cs8q==1d^jj#'cL3x1q5    r   nmaxc                 s"   R pR.V,          p\        RP                  V4      4      p\        P                  ! V\        RV R7      p\        V4      V 8X  g   Q h\        4       w  rV\        P                  ! V4       \        VR4      ;_uu_ 4       pVP                  RP                  V4      4       RRR4       \        P                  ! V\        RV R7      p\        P                  ! V4       \        V4      V 8X  g   Q hR#   + '       g   i     LX; i)ru  za 0.5 1r   r   r{   r
  N)r    r   r   r   strri  r   rj  rk  rl  r  rm  )r|  file_lengthr   r$   r~   rq  rr  r  r;   r    test_maxrows_exceeding_chunksizer  !  s     K ;$D
499T?
#C
**SsT
BCs8t 	IBHHRL	eS		R
4! 

**U#t
DCIIes8t	 
	s   !C>>D	nskipc                 sZ   R pRP                  R \        ^V^,           4       4       4      p\        RW!,
          4      p\        P                  ! V^,           V^,           V,           4      P                  \        4      p\        V4      p\        P                  ! VRRVRR7      p\        V4      V8X  g   Q h\        WWR	,          4       V R,          pVP                  V4       \        V4      p	\        P                  ! V	RRVRR7      p\        V4      V8X  g   Q h\        WWR	,          4       R# )
i r   c              3   s*   "   T F	  q R 2x  K  	  R# 5i)z a 0.5 1Nr   )Z.0r   r   r   Z	<genexpr>ZEtest_skiprow_exceeding_maxrows_exceeding_chunksize.<locals>.<genexpr>;  s     G-Fs(^-Fs   ru  r}  r   )r,   r	   r6   r|   ztest_data.txtNrS  )r   r   Zminr   Zaranger  r}  r    r   ri  r   r  )
Ztmpdirr  r~  r   Zexpected_lengthr   r$   r~   Ztmp_filerr  s
   &&        r   2test_skiprow_exceeding_maxrows_exceeding_chunksizer  6  s     K99GU1kAo-FGGD%!45OyyEAI$?@GGLH 4.C
**Suu
UCs8&&&xT+ 'HNN4ME
**U%3QV
WCs8&&&xT+r   )z..z//z@-zthis is a comment:)r   rA   r   rC   )r6   r|   )z
1 2 3 4 5
)rA   rW   )z
1
2
3
4
5
)rW   rA   )r0   rC   Nzplate of shrimp)r   Z	u    t    u   　)rD   rC   rE   )r%   u   のu   🫕)r   r   )FT)rC   r^   )r   r   Z`)r   z


z# 1 2 3
# 4 5 6
)r   rA   r   r$  rB   )r   rA   )Zu2rA   )Zi4 )Zu4r  )Zi8   
 )Zu8r  )Zfloat16g#{ ?)r   g. 7)	complex64y. 7`F$:)r2   gywfUD3":)Z
longdoubler  yp`P@0 B B)ZU2u   𐈃򠬌)z1 +2jz1+ 2jz1+2 jz1+-+3z(1jz(1z(1+2jz1+2j))r   rU  rV  )r   rU  )rn  ro  rp  r   )z2012-03z
2013-01-15ZM8zM8[D])rt  rv  r   rw  )rX   r   ru  )r   r   i  ru  )r   r   i90  r   i3	 i )nZ__doc__rj  r   Zior    Ztempfiler   r   r`   Znumpyr   Znumpy.ma.testutilsr   Znumpy.testingr   r   r   r   rW  rX  r'   Zfixturer5   r9   r<   rH   rI   rT   rY   re   ri   rm   ro   ry   rz   rP   r   r   ZskipifZimplementationZversionr,   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z	typecodesZfilterwarningsr   r   r  r  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  Zreprr  r  r  r  r  r  r  r  r#  r&  r7  r8  r\  r^  r`  ra  re  rg  rs  rx  ry  rz  r{  r  r  r   r   r   <module>r     sI   
 
  0   + C CB  $LM: N: ! !@ \2/ 3/*O@LL ":;- <- ":;. <.
 #NN #CD, E,
 		  5&/2O 3O GGG 2 2 : :i G9  ;288D>288D>"BC4 D;4 0&(E% 3434  5 5    $7 ),. -. %	bhhtn	bhhtn,, &= GGG 2 2 : :i G9  ;",,|"<=NO4 P >;4 GGG 2 2 : :i G9  ;",,|"<=NO4 P >;4
 2<<"?@6	  7 A	   7 $-EF* G*& GGG 2 2 : :i G9  ;%;% !eWb!12: 3: GGG 2 2 : :i G9  ;K;K 08 18< o.
& /
& o.
& /
&&" GGG 2 2 : :i G9  ;7;7( &:    !EF),T9$56+ 7 - G+* V,+ -+ '7+."$>!K+ 
tJKL 	)	GHI&!.( )" $/) 0#)$) 
\"W,s24<4< $'Q (Q GGG 2 2 : :i G9  ;$'KM?M (;
?
 GGG 2 2 : :i G9  ;LL&2S8:I:;I GGG 2 2 : :i G9  ;
\"Y.46+6;+ ii" (( ikkm	" 22 $89K :KN<FG FGRE
F
C
L 	J	J |,& -& F07 "45 / 6 /F0 GGG 2 2 : :i G9  ;:;: 12! 3! !=> ?( "IJ, K,r   