a
    d                     @   s.   d dl Z d dlZd dlmZ G dd dZdS )    Nc                   @   sR   e Zd ZdZejeedddZejeed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   o/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/pandas/tests/extension/base/accumulate.py_supports_accumulation   s    z*BaseAccumulateTests._supports_accumulation)r   r   skipnac                 C   sn   | d}t|||d}|jt krJ|dkrJ|rJtd| d|  t|||d}tj||dd d S )N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_accumulater
   TFc                 C   sh   |}t |}| ||r*| ||| n:tt  t|||d W d    n1 sZ0    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   