U
    ¾mœdç  ã                   @   s�   d dl mZ d dlZd dlZd dlmZ d dlZd dlmZ e 	d¡Z
de
j_de
j_de
j_dd„ Zedeeddf dœdd„ƒZdd„ ZdS )é    )ÚcontextmanagerN)Ú	Generator)ÚHDFStoreÚtablesé   c                 C   s.   z| d k	r|   ¡  W n tk
r(   Y nX d S )N)ÚcloseÚOSError)Ústore© r
   úX/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/pandas/tests/io/pytables/common.pyÚ
safe_close   s
    r   ÚaF)Úreturnc              
   c   sH   t  ¡ �6}t || ¡}t|||||d��}|V  W 5 Q R X W 5 Q R X d S )N)ÚmodeÚ	complevelÚcomplibÚ
fletcher32)ÚtempfileÚTemporaryDirectoryÚpathlibÚPathr   )Úpathr   r   r   r   Z
tmpdirnameZtmp_pathr	   r
   r
   r   Úensure_clean_store   s    
ûr   c              	   C   s,   z|   |¡ W n ttfk
r&   Y nX dS )zŠ
    For tests using tables, try removing the table to be sure there is
    no content from previous tests using the same table name.
    N)ÚremoveÚ
ValueErrorÚKeyError)r	   Úkeyr
   r
   r   Ú_maybe_remove*   s    r   )r   NNF)Ú
contextlibr   r   r   Útypingr   ZpytestZpandas.io.pytablesr   Zimportorskipr   Ú
parametersZMAX_NUMEXPR_THREADSZMAX_BLOSC_THREADSZMAX_THREADSr   r   r   r
   r
   r
   r   Ú<module>   s&   
	       ÿþ