o
    5cG
                     @   sR   d dl Z d dlZd dlmZ d dlmZ e dZ	e j
dd ZG dd dZdS )    N)ensure_clean_pathtablesc            
   	   c   s   t jddt jdddt jddd} d}|ddd|d d	dd|d d
dd|d dddg}d}tdI}t j|dd(}|jd|| d}|D ]}| D ]	\}}	|	|j|< qQ|j	  qKW d   n1 skw   Y  ||t
|fV  W d   dS 1 sw   Y  dS )z4
    Use PyTables to create a simple HDF5 file.
    r   )pos         )c0c1c2g   $CAaaaaabbbbbccccci    dddddl    pandas_test_timeserieszwritten_with_pytables.h5w)mode/)namedescriptionN)r   	Time64Col	StringColInt64Colr   	open_filecreate_tableitemsrowappendpd	DataFrame)
table_schemat0testsamplesobjnamepathftsamplekeyvalue r*   Z/var/www/html/gps/gps/lib/python3.10/site-packages/pandas/tests/io/pytables/test_compat.pypytables_hdf5_file
   s.   



"r,   c                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )TestReadPyTablesHDF5z
    A group of tests which covers reading HDF5 files written by plain PyTables
    (not written by pandas).

    Was introduced for regression-testing issue 11188.
    c                 C   s,   |\}}}t j||d}|}t|| d S )N)r(   )r   read_hdftmassert_frame_equalselfr,   r$   r#   dfresultexpectedr*   r*   r+   test_read_complete4   s   
z'TestReadPyTablesHDF5.test_read_completec                 C   s>   |\}}}t j||dd}|dd  jdd}t|| d S )Nr   )r(   startTdropr   r.   reset_indexr/   r0   r1   r*   r*   r+   test_read_with_start:      
z)TestReadPyTablesHDF5.test_read_with_startc                 C   s>   |\}}}t j||dd}|d d jdd}t|| d S )Nr   )r(   stopTr8   r:   r1   r*   r*   r+   test_read_with_stopA   r=   z(TestReadPyTablesHDF5.test_read_with_stopc                 C   s@   |\}}}t j||ddd}|dd jdd}t|| d S )Nr   r   )r(   r7   r>   Tr8   r:   r1   r*   r*   r+   test_read_with_startstopH   s   
z-TestReadPyTablesHDF5.test_read_with_startstopN)__name__
__module____qualname____doc__r6   r<   r?   r@   r*   r*   r*   r+   r-   ,   s    r-   )pytestpandasr   pandas._testing_testingr/   pandas.tests.io.pytables.commonr   importorskipr   fixturer,   r-   r*   r*   r*   r+   <module>   s    

!