o
    g                     @  s  d dl mZ d dlZd dlZd dlmZmZ G dd dZG dd deZG dd	 d	eZ	G d
d deZ
G dd deZejdd Zejdd Ze	 Ze
 Ze ZegZeegZg eeZdgZddgZg eeZejeeddd Zejeeddd Zejeeddd Zdd Zeje d e d dd d! Zg d"Zg d#Zd$d%gZd&d' eD Z ejed(d)d* Z!eje d(d+d, Z"ejg d-d(d.d/ Z#dS )0    )annotationsN)read_csv
read_tablec                   @  sB   e Zd ZU dZded< dZg Zded< dd Zd	d
 Zdd Z	dS )
BaseParserNz
str | NoneengineTzlist[str | None]float_precision_choicesc                 C  s    |  }|| j| jd |S )N)r   
low_memory)copyupdater   r   )selfkwargs r   ]/home/ubuntu/cloudmapper/venv/lib/python3.10/site-packages/pandas/tests/io/parser/conftest.pyupdate_kwargs   s   zBaseParser.update_kwargsc                 O     |  |}t|i |S N)r   r   r   argsr   r   r   r   r         
zBaseParser.read_csvc                 O  r   r   )r   r   r   r   r   r   r      r   zBaseParser.read_table)
__name__
__module____qualname__r   __annotations__r   r   r   r   r   r   r   r   r   r      s   
 r   c                   @  s   e Zd ZdZg dZdS )CParserc)Nhigh
round_tripNr   r   r   r   r   r   r   r   r   r   !   s    r   c                   @     e Zd ZdZdS )CParserHighMemoryFNr   r   r   r   r   r   r   r   r   &       r   c                   @  r   )CParserLowMemoryTNr    r   r   r   r   r"   *   r!   r"   c                   @  s   e Zd ZdZdgZdS )PythonParserpythonNr   r   r   r   r   r#   .   s    
r#   c                 C  s   | dddS )zG
    The directory path to the data files needed for parser tests.
    ioparserdatar   datapathr   r   r   csv_dir_path3   s   r*   c                 C  s   t j| ddddS )zH
    The path to the data file "test1.csv" needed for parser tests.
    r%   r'   csvz	test1.csv)ospathjoinr(   r   r   r   csv1;   s   r/   r$   c_highc_lowparamsidsc                 C     | j S )z)
    Fixture all of the CSV parsers.
    paramrequestr   r   r   all_parsersP      r:   c                 C  r5   )z<
    Fixture all of the CSV parsers using the C engine.
    r6   r8   r   r   r   c_parser_onlyX   r;   r<   c                 C  r5   )zA
    Fixture all of the CSV parsers using the Python engine.
    r6   r8   r   r   r   python_parser_only`   r;   r=   c                  C  sT   g } g }t ttD ]\}}|jD ]}| ||f || d|  qq	| |dS )za
    Return all allowable parser and float precision
    combinations and corresponding ids.
    -r2   )zip_all_parsers_all_parser_idsr   append)r3   r4   r&   	parser_id	precisionr   r   r   ,_get_all_parser_float_precision_combinationsh   s   

rE   r3   r4   c                 C  r5   )zR
    Fixture for all allowable combinations of parser
    and float precision
    r6   r8   r   r   r   all_parsers_all_precisionsw   s   	rF   )          ) r>   _utfUTFc                 C  s&   g | ]}t D ]
}| | d  qqS )z{0})_encoding_prefixes).0sepprefixr   r   r   
<listcomp>   s
    rR   )r3   c                 C  r5   )zE
    Fixture for all possible integer values for a UTF encoding.
    r6   r8   r   r   r   	utf_value   r;   rS   c                 C  r5   )zD
    Fixture for all possible string formats of a UTF encoding.
    r6   r8   r   r   r   encoding_fmt   r;   rT   )*)z-1,0      )z-1,2e0g333333)z-1e0rU   )z+1e0      ?)z+1e+0rV   )z+1e-1皙?)z+,1e1rV   )z+1,e0rV   )z-,1e1rU   )z-1,e0rU   )z0,1rW   )z1,rV   )z,1rW   )z-,1g)z1_,rV   )z1_234,56
ףp=J@)z
1_234,56e0rX   )rK   rK   )-_rY   )-_1rZ   )-_1e0r[   )_1r\   )_1,r]   )_1,_r^   )_1e0r_   )1,2e_1r`   )1,2e1_0ra   )1,_2rb   ),1__2rc   ),1erd   )-,1ere   )1_000,000_000rf   )1,e1_2rg   )e11,2rh   )1e11,2ri   )1,2,2rj   )1,2_1rk   )	1,2e-10e1rl   )--1,2rm   )1a_2,1rn   )z1,2E-1gQ?)z1,2E1g      (@c                 C  r5   )z
    Fixture for all numeric formats which should get recognized. The first entry
    represents the value to read while the second represents the expected result.
    r6   r8   r   r   r   numeric_decimal   s   4ro   )$
__future__r   r,   pytestpandasr   r   r   r   r   r"   r#   fixturer*   r/   _cParserHighMemory_cParserLowMemory_pythonParser_py_parsers_only_c_parsers_onlyr@   _py_parser_ids_c_parser_idsrA   r:   r<   r=   rE   rF   _utf_values_encoding_sepsrN   _encoding_fmtsrS   rT   ro   r   r   r   r   <module>   s`    









/