o
    eÇ  ã                   @   s.   d dl Z d dlZd dlmZ G dd„ dƒZdS )é    Nc                   @   sZ   e Zd ZdZdejdedefdd„Zdejdedefdd	„Z	e
j dd
dg¡dd„ ƒZdS )ÚBaseAccumulateTestszj
    Accumulation specific tests. Generally these only
    make sense for numeric/boolean operations.
    ÚserÚop_nameÚreturnc                 C   s   dS )NF© )Úselfr   r   r   r   úVD:\Projects\ConvertPro\env\Lib\site-packages\pandas/tests/extension/base/accumulate.pyÚ_supports_accumulation   s   z*BaseAccumulateTests._supports_accumulationÚskipnac                 C   sn   |  d¡}t||ƒ|d�}|jt ¡ kr%|dkr%|r%t d|› d|› �¡ t||ƒ|d�}tj||dd� d S )NZfloat64©r
   Zcumprodz4Float32 precision lead to large differences with op z and skipna=F)Zcheck_dtype)	ZastypeÚgetattrZdtypeÚpdZFloat32DtypeÚpytestÚskipÚtmZassert_series_equal)r   r   r   r
   ZaltÚresultÚexpectedr   r   r   Úcheck_accumulate   s   
ÿÿz$BaseAccumulateTests.check_accumulateTFc                 C   sl   |}t  |¡}|  ||¡r|  |||¡ d S t t¡� t||ƒ|d� W d   ƒ d S 1 s/w   Y  d S )Nr   )r   ÚSeriesr	   r   r   ZraisesÚNotImplementedErrorr   )r   ÚdataZall_numeric_accumulationsr
   r   r   r   r   r   Útest_accumulate_series    s   
"ÿz*BaseAccumulateTests.test_accumulate_seriesN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚstrÚboolr	   r   r   ÚmarkZparametrizer   r   r   r   r   r      s    r   )r   Zpandasr   Zpandas._testingZ_testingr   r   r   r   r   r   Ú<module>   s    