
    d                        d Z ddlZddlZddlmZ ddlZddlm	Z
 ddlmZ ddlmZmZ ddlmZ d Z ej        eeg          d	             Zej        d
             Zej        d             Zej        d             Zej        d             Zej        d             Zej        d             Zej        d             Zej        d             Z G d dej                  Z G d dej                  Z  G d dej!                  Z" G d dej#                  Z$ G d dej%                  Z& G d dej'                  Z( G d dej)                  Z* G d  d!ej+                  Z, G d" d#ej-                  Z. G d$ d%ej/                  Z0 G d& d'ej1                  Z2 G d( d)ej3                  Z4 G d* d+ej5                  Z6 G d, d-ej7                  Z8ej9        :                    d./           G d0 d1ej;                              Z< G d2 d3ej=                  Z> G d4 d5ej?                  Z@ej9        A                    d6           G d7 d8ejB                              ZC G d9 d:ejD                  ZEdS );aj  
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.

The tests in this file are inherited from the BaseExtensionTests, and only
minimal tweaks should be applied to get the tests passing (by overwriting a
parent method).

Additional tests should either be added to one of the BaseExtensionTests
classes (if they are relevant for the extension interface for all dtypes), or
be added to the array-specific tests in `pandas/tests/arrays/`.

    N)is_extension_array_dtype)is_float_dtype)Float32DtypeFloat64Dtype)basec                      t          t          j        ddd                    t          j        gz   t          t          j        ddd                    z   t          j        gz   ddgz   S )N皙?g?   g#@g#@g      $@)listnparangepdNA     `/var/www/html/t/fyr/venv311/lib/python3.11/site-packages/pandas/tests/extension/test_floating.py	make_datar      sf    RYsC%%&&5'	
ryC%%
&
&	' 5'	 +		r   )paramsc                 *    |                                  S N)param)requests    r   dtyper   )   s    ==??r   c                 F    t          j        t                      |           S )Nr   )r   arrayr   r   s    r   datar   .   s    8IKKu----r   c                 X    t          j        t          j        d          dz  |           S )Nd      r   )r   r   r   onesr   s    r   data_for_twosr"   3   s$    8BGCLL1$E2222r   c                 F    t          j        t           j        dg|           S )Nr	   r   r   r   r   r   s    r   data_missingr%   8   s    8RUCL....r   c                 2    t          j        g d|           S )N)r	   皙?        r   )r   r   r   s    r   data_for_sortingr)   =   s    8OOO51111r   c                 H    t          j        dt           j        dg|           S )Nr	   r(   r   r$   r   s    r   data_missing_for_sortingr+   B   s     8S"%%U3333r   c                      d S )Nc                 :    | t           j        u o|t           j        u S r   r   r   )xys     r   <lambda>zna_cmp.<locals>.<lambda>J   s    RU
1qBEz r   r   r   r   r   na_cmpr2   G   s     211r   c                      t           j        S r   r.   r   r   r   na_valuer4   M   s	    5Lr   c           
      b    d}d}d}t           j        }t          j        ||||||||g|           S )Nr	   r(   r'   r   )r   r   r   )r   bacnas        r   data_for_groupingr:   R   s>    AAA	B8Q2r1aA.e<<<<r   c                       e Zd ZdS )	TestDtypeN__name__
__module____qualname__r   r   r   r<   r<   [           Dr   r<   c                   6     e Zd Zd fd	ZefdZd fd	Z xZS )TestArithmeticOpsNc                 R    t                                          |||d            d S N)excsupercheck_opnameselfsop_nameotherrF   	__class__s        r   rI   zTestArithmeticOps.check_opname`   s*    QD99999r   c                    |t          j        |          }t          |d          rBt          |j                  s.t          |j                  r|                    |j                  } |||          }|                     |||          }|                    |          }| 	                    ||           d S t          j        |          5   |||           d d d            d S # 1 swxY w Y   d S )Nr   )tm	get_dtypehasattrr   r   r   astypenumpy_dtype_combineassert_equalpytestraises)	rK   rL   oprN   rM   rF   sdtyperesultexpecteds	            r   	_check_opzTestArithmeticOps._check_opd   s8   ;\!__Fw''90==9 #5;//9 V%788R5\\F}}Qr22H  v..Hfh/////s##  1e                 s   C''C+.C+c                 P    t                                          |||d            d S r   )rH   _check_divmod_op)rK   rL   rZ   rN   rF   rO   s        r   r`   z"TestArithmeticOps._check_divmod_op{   s'      Bt44444r   r   )r>   r?   r@   rI   NotImplementedErrorr^   r`   __classcell__rO   s   @r   rC   rC   _   su        : : : : : : 4G    .5 5 5 5 5 5 5 5 5 5r   rC   c                   0     e Zd ZefdZd fd	Zd Z xZS )TestComparisonOpsc                    |M |||          }|                     ||                              d          }|                     ||           d S t          j        |          5   |||           d d d            d S # 1 swxY w Y   d S )Nboolean)combinerT   assert_series_equalrX   rY   )rK   rL   rZ   rN   rM   rF   r\   r]   s           r   r^   zTestComparisonOps._check_op   s    ;R5\\Fyy++229==H$$VX66666s##  1e                 s   $A>>BBNc                 R    t                                          |||d            d S rE   rG   rJ   s        r   rI   zTestComparisonOps.check_opname   s*    QD99999r   c                 J    d|j          d}|                     |||           d S )N__)r>   rI   )rK   rL   r   rZ   rN   rM   s         r   _compare_otherz TestComparisonOps._compare_other   s2    &r{&&&!We,,,,,r   r   )r>   r?   r@   ra   r^   rI   rm   rb   rc   s   @r   re   re      sc        3F    : : : : : :- - - - - - -r   re   c                       e Zd ZdS )TestInterfaceNr=   r   r   r   ro   ro      rA   r   ro   c                       e Zd ZdS )TestConstructorsNr=   r   r   r   rq   rq      rA   r   rq   c                       e Zd ZdS )TestReshapingNr=   r   r   r   rs   rs      rA   r   rs   c                       e Zd ZdS )TestGetitemNr=   r   r   r   ru   ru      rA   r   ru   c                       e Zd ZdS )TestSetitemNr=   r   r   r   rw   rw      rA   r   rw   c                       e Zd ZdS )	TestIndexNr=   r   r   r   ry   ry      rA   r   ry   c                       e Zd ZdS )TestMissingNr=   r   r   r   r{   r{      rA   r   r{   c                       e Zd ZeZdS )TestMethodsN)r>   r?   r@   object_combine_le_expected_dtyper   r   r   r}   r}      s        !'r   r}   c                       e Zd ZdS )TestCastingNr=   r   r   r   r   r      rA   r   r   c                       e Zd ZdS )TestGroupbyNr=   r   r   r   r   r      rA   r   r   c                       e Zd Zd ZdS )TestNumericReducec                 *   |dk    r` t          ||                      } t          |                                                    |j        j                  |                      }n t          ||          |          } t          |                                                    |j        j                  |          |          }|s2|                                                                rt          j        }t          j
        ||           d S )Ncount)skipna)getattrdropnarT   r   rU   isnaanyr   r   rQ   assert_almost_equal)rK   rL   rM   r   r\   r]   s         r   check_reducezTestNumericReduce.check_reduce   s     g(WQ((**FOwqxxzz001DEEwOOQQHH(WQ((777FOwqxxzz001DEEwOO  H  !affhhllnn !5
vx00000r   N)r>   r?   r@   r   r   r   r   r   r      s#        1 1 1 1 1r   r   z-Tested in tests/reductions/test_reductions.py)reasonc                       e Zd ZdS )TestBooleanReduceNr=   r   r   r   r   r              Dr   r   c                       e Zd ZdS )TestPrintingNr=   r   r   r   r   r      rA   r   r   c                       e Zd ZdS )TestParsingNr=   r   r   r   r   r      rA   r   r   z4ignore:overflow encountered in reduce:RuntimeWarningc                       e Zd ZdS )Test2DCompatNr=   r   r   r   r   r      r   r   r   c                   Z    e Zd Zej                            dddg          d             ZdS )TestAccumulationr   TFc                     d S r   r   )rK   r   all_numeric_accumulationsr   s       r   test_accumulate_series_raisesz.TestAccumulation.test_accumulate_series_raises   s    r   N)r>   r?   r@   rX   markparametrizer   r   r   r   r   r      sD        [Xe}55  65  r   r   )F__doc__numpyr   rX   pandas.core.dtypes.commonr   pandasr   pandas._testing_testingrQ   pandas.api.typesr   pandas.core.arrays.floatingr   r   pandas.tests.extensionr   r   fixturer   r   r"   r%   r)   r+   r2   r4   r:   BaseDtypeTestsr<   BaseArithmeticOpsTestsrC   BaseComparisonOpsTestsre   BaseInterfaceTestsro   BaseConstructorsTestsrq   BaseReshapingTestsrs   BaseGetitemTestsru   BaseSetitemTestsrw   BaseIndexTestsry   BaseMissingTestsr{   BaseMethodsTestsr}   BaseCastingTestsr   BaseGroupbyTestsr   BaseNumericReduceTestsr   r   skipBaseBooleanReduceTestsr   BasePrintingTestsr   BaseParsingTestsr   filterwarningsDim2CompatTestsr   BaseAccumulateTestsr   r   r   r   <module>r      sn         > > > > > >           + + + + + +        ( ' ' ' ' '   l3444  54 . . . 3 3 3 / / / 2 2 2 4 4 4 2 2 2
    = = =	 	 	 	 	# 	 	 	5 5 5 5 53 5 5 5@- - - - -3 - - -(	 	 	 	 	D+ 	 	 		 	 	 	 	t1 	 	 		 	 	 	 	D+ 	 	 		 	 	 	 	$' 	 	 		 	 	 	 	$' 	 	 		 	 	 	 	# 	 	 		 	 	 	 	$' 	 	 	( ( ( ( ($' ( ( (	 	 	 	 	$' 	 	 		 	 	 	 	$' 	 	 	1 1 1 1 13 1 1 1" HII	 	 	 	 	3 	 	 JI		 	 	 	 	4) 	 	 		 	 	 	 	$' 	 	 	 RSS	 	 	 	 	4' 	 	 TS	    t/     r   