
    Mh	                        S r SSKJr  SSKrSSKJr  SSKrSSKJ	r	  SSK
rSSKJr  \(       a  SSKJr   " S S	\	5      r " S
 S\5      rg)zX
Test extension array that has custom attribute information (not stored on the dtype).

    )annotationsN)TYPE_CHECKING)ExtensionDtype)ExtensionArray)type_tc                  H    \ rS rSr\rSr\R                  r	\
SS j5       rSrg)FloatAttrDtype   
float_attrc                    [         $ )zI
Return the array type associated with this dtype.

Returns
-------
type
)FloatAttrArray)clss    ^/var/www/html/env/lib/python3.13/site-packages/pandas/tests/extension/array_with_attr/array.pyconstruct_array_type#FloatAttrDtype.construct_array_type   s
          N)returnztype_t[FloatAttrArray])__name__
__module____qualname____firstlineno__floattypenamenpnanna_valueclassmethodr   __static_attributes__r   r   r   r	   r	      s'    DDvvH r   r	   c                      \ rS rSr\" 5       rSrSSS jjr\SSS.S j5       r	S r
SS	 jrS
 rSS jrS r\S 5       rSrg)r   &   i  Nc                    [        U[        R                  5      (       d  [        S5      eUR                  S:X  d  [        S5      eXl        X l        g )Nz5Need to pass a numpy array of float64 dtype as valuesfloat64)
isinstancer   ndarray	TypeErrordtypedataattr)selfvaluesr*   s      r   __init__FloatAttrArray.__init__*   sA    &"**--STT||y(STT		r   Fr(   copyc               x    U(       d  [         R                  " USS9nO[         R                  " USUS9nU " U5      $ )Nr$   )r(   r/   )r   asarrayarray)r   scalarsr(   r0   r)   s        r   _from_sequenceFloatAttrArray._from_sequence2   s1    ::gY7D88G94@D4yr   c                   [        U[        R                  5      (       a  U R                  U   $ [        R
                  R                  R                  X5      n[        U 5      " U R                  U   U R                  5      $ N)
r%   numbersIntegralr)   pdapiindexerscheck_array_indexerr   r*   )r+   items     r   __getitem__FloatAttrArray.__getitem__:   sZ    dG,,--99T?" 66??66tBD:diiotyy99r   c                ,    [        U R                  5      $ r8   )lenr)   r+   s    r   __len__FloatAttrArray.__len__B   s    499~r   c                B    [         R                  " U R                  5      $ r8   )r   isnanr)   rD   s    r   isnaFloatAttrArray.isnaE   s    xx		""r   c                    SSK Jn  U R                  nU(       a  Uc  U R                  R                  nU" XQX2S9n[        U 5      " X`R                  5      $ )Nr   )take)
fill_value
allow_fill)pandas.api.extensionsrL   r)   r(   r   r   r*   )r+   indexerrN   rM   rL   r)   results          r   rL   FloatAttrArray.takeH   sD    .yy*,,,Jd
RDz&)),,r   c                j    [        U 5      " U R                  R                  5       U R                  5      $ r8   )r   r)   r0   r*   rD   s    r   r0   FloatAttrArray.copyR   s"    Dz$))..*DII66r   c                    [         R                  " U Vs/ s H  o"R                  PM     sn5      n[        U5      (       a  US   R                  OS nU " X45      $ s  snf )Nr   )r   concatenater)   rC   r*   )r   	to_concatxr)   r*   s        r   _concat_same_type FloatAttrArray._concat_same_typeU   sI    ~~y9y!vvy9:$'	NNy|  4 :s   A)r*   r)   r8   )r   None)r   int)FN)r   r   r   r   r	   r(   __array_priority__r-   r   r5   r@   rE   rI   rL   r0   rY   r    r   r   r   r   r   &   s[    E .2  :#-7  r   r   )__doc__
__future__r   r9   typingr   numpyr   pandas.core.dtypes.baser   pandasr;   pandas.core.arraysr   pandas._typingr   r	   r   r   r   r   <module>rf      s?    #     2  -%^ "3^ 3r   