o
    5c                     @   sB  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d Zejeegd	d
d Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd Zejdd ZG dd dejZG dd dejZ G d d! d!ej!Z"G d"d# d#ej#Z$G d$d% d%ej%Z&G d&d' d'ej'Z(G d(d) d)ej)Z*G d*d+ d+ej+Z,G d,d- d-ej-Z.G d.d/ d/ej/Z0G d0d1 d1ej1Z2G d2d3 d3ej3Z4G d4d5 d5ej5Z6G d6d7 d7ej7Z8ej9j:d8d9G d:d; d;ej;Z<G d<d= d=ej=Z>G d>d? d?ej?Z@G d@dA dAejAZBdS )Baj  
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                   C   s<   t tdddtjg t tddd tjg ddg S )N皙?g?   g#@g#@g      $@)listnparangepdNA r   r   Z/var/www/html/gps/gps/lib/python3.10/site-packages/pandas/tests/extension/test_floating.py	make_data   s   r   )paramsc                 C   s   |   S N)param)requestr   r   r   dtype)   s   r   c                 C   s   t jt | dS )Nr   )r   arrayr   r   r   r   r   data.   s   r   c                 C   s   t jtdd | dS )Nd      r   )r   r   r
   onesr   r   r   r   data_for_twos3      r   c                 C   s   t jt jdg| dS )Nr   r   r   r   r   r   r   r   r   data_missing8   s   r   c                 C   s   t jg d| dS )N)r   皙?        r   )r   r   r   r   r   r   data_for_sorting=   s   r"   c                 C   s   t jdt jdg| dS )Nr   r!   r   r   r   r   r   r   data_missing_for_sortingB   s   r#   c                   C   s   dd S )Nc                 S   s   | t ju o	|t ju S r   r   r   )xyr   r   r   <lambda>J   s    zna_cmp.<locals>.<lambda>r   r   r   r   r   na_cmpG   s   r(   c                   C   s   t jS r   r$   r   r   r   r   na_valueM   s   r)   c              	   C   s0   d}d}d}t j}t j||||||||g| dS )Nr   r!   r    r   )r   r   r   )r   bacnar   r   r   data_for_groupingR   s
   r.   c                   @      e Zd ZdS )	TestDtypeN__name__
__module____qualname__r   r   r   r   r0   [       r0   c                       s8   e Zd Zd fdd	ZefddZd fdd	Z  ZS )	TestArithmeticOpsNc                       t  j|||d d d S N)excsupercheck_opnameselfsop_nameotherr9   	__class__r   r   r<   `   r   zTestArithmeticOps.check_opnamec           	      C   s   |d u r7t |}t|drt|jst|jr||j}|||}| |||}||}| 	|| d S t
| ||| W d    d S 1 sMw   Y  d S )Nr   )tm	get_dtypehasattrr   r   r   astypenumpy_dtype_combineassert_equalpytestraises)	r>   r?   oprA   r@   r9   sdtyperesultexpectedr   r   r   	_check_opd   s    


"zTestArithmeticOps._check_opc                    s   t  |||d  d S r   )r;   _check_divmod_op)r>   r?   rM   rA   r9   rB   r   r   rR   {   s   z"TestArithmeticOps._check_divmod_opr   )r2   r3   r4   r<   NotImplementedErrorrQ   rR   __classcell__r   r   rB   r   r6   _   s    r6   c                       s2   e Zd ZefddZd fdd	Zdd Z  ZS )	TestComparisonOpsc                 C   sn   |d u r|||}| ||d}| || d S t| ||| W d    d S 1 s0w   Y  d S )Nboolean)combinerG   assert_series_equalrK   rL   )r>   r?   rM   rA   r@   r9   rO   rP   r   r   r   rQ      s   
"zTestComparisonOps._check_opNc                    r7   r8   r:   r=   rB   r   r   r<      s   zTestComparisonOps.check_opnamec                 C   s    d|j  d}| ||| d S )N__)r2   r<   )r>   r?   r   rM   rA   r@   r   r   r   _compare_other   s   z TestComparisonOps._compare_otherr   )r2   r3   r4   rS   rQ   r<   rZ   rT   r   r   rB   r   rU      s    
rU   c                   @   r/   )TestInterfaceNr1   r   r   r   r   r[      r5   r[   c                   @   r/   )TestConstructorsNr1   r   r   r   r   r\      r5   r\   c                   @   r/   )TestReshapingNr1   r   r   r   r   r]      r5   r]   c                   @   r/   )TestGetitemNr1   r   r   r   r   r^      r5   r^   c                   @   r/   )TestSetitemNr1   r   r   r   r   r_      r5   r_   c                   @   r/   )	TestIndexNr1   r   r   r   r   r`      r5   r`   c                   @   r/   )TestMissingNr1   r   r   r   r   ra      r5   ra   c                   @   r/   )TestMethodsNr1   r   r   r   r   rb      r5   rb   c                   @   r/   )TestCastingNr1   r   r   r   r   rc      r5   rc   c                   @   r/   )TestGroupbyNr1   r   r   r   r   rd      r5   rd   c                   @   s   e Zd Zdd ZdS )TestNumericReducec                 C   sV   t |||d}|s|  rtj}nt | |jj||d}t	
|| d S )N)skipna)getattrisnaanyr   r   dropnarG   r   rH   rD   assert_almost_equal)r>   r?   r@   rf   rO   rP   r   r   r   check_reduce   s   zTestNumericReduce.check_reduceN)r2   r3   r4   rl   r   r   r   r   re      s    re   z-Tested in tests/reductions/test_reductions.py)reasonc                   @   r/   )TestBooleanReduceNr1   r   r   r   r   rn      s    rn   c                   @   r/   )TestPrintingNr1   r   r   r   r   ro      r5   ro   c                   @   r/   )TestParsingNr1   r   r   r   r   rp      r5   rp   c                   @   r/   )Test2DCompatNr1   r   r   r   r   rq      r5   rq   )C__doc__numpyr
   rK   pandas.core.dtypes.commonr   pandasr   pandas._testing_testingrD   pandas.api.typesr   pandas.core.arrays.floatingr   r   pandas.tests.extensionr   r   fixturer   r   r   r   r"   r#   r(   r)   r.   BaseDtypeTestsr0   BaseArithmeticOpsTestsr6   BaseComparisonOpsTestsrU   BaseInterfaceTestsr[   BaseConstructorsTestsr\   BaseReshapingTestsr]   BaseGetitemTestsr^   BaseSetitemTestsr_   BaseIndexTestsr`   BaseMissingTestsra   BaseMethodsTestsrb   BaseCastingTestsrc   BaseGroupbyTestsrd   BaseNumericReduceTestsre   markskipBaseBooleanReduceTestsrn   BasePrintingTestsro   BaseParsingTestsrp   Dim2CompatTestsrq   r   r   r   r   <module>   s^    









 