
    .i5                        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 e	j                  D  cg c]  }  ej                  g d|        c} Zee	j                  D  cg c]  }  ej                  g d|        c} z  Z ej                   eeD cg c]  }|j"                  j$                   c}      d        Zej                   d	        Zd
 Zd Zd Zyc c} w c c} w c c}w )    N)is_integer_dtype)BaseMaskedArray)         Ndtype)g?5^I?gx&ѿgGz@N)paramsidsc                     | j                   S )zi
    Fixture returning parametrized 'data' array with different integer and
    floating point types
    )param)requests    f/var/www/app/trading-bot/venv/lib/python3.12/site-packages/pandas/tests/arrays/masked/test_function.pydatar      s     ==    c                 X    t        |       rt        }|S | j                  j                  }|S )z@
    Fixture returning numpy dtype from 'data' input array.
    )r   floatr	   type)r   numpy_dtypes     r   r   r      s.       jjoor   c                    | j                         }t        j                   | j                  |d             }|j                  t              }t
        j                  || j                         <   t        j                  || j                        }t        j                  ||       | j                  d      }t        j                   | j                  |d       d      }|j                  t              }t
        j                  || j                         <   t        j                  || j                        }t        j                  ||       y )N)r	   na_valuer   r   )decimals)roundnpto_numpyastypeobjectpdNAisnaarrayr	   tmassert_extension_array_equal)r   r   result	np_resultexp_npexpecteds         r   
test_roundr(   &   s    ZZ\F[4HIIf%F%%F499;xxdjj1H##FH5 ZZZ#F[4HSTUIf%F%%F499;xxdjj1H##FH5r   c                 f    | j                         }t        |       }t        j                  ||       y )N)tolistlistr"   assert_equal)r   r$   r'   s      r   test_tolistr-   8   s$    [[]FDzHOOFH%r   c                  "    G d dt               }  | t        j                  g d      t        j                  g d            }|j                         }t        j                  dt        j
                  dg      }t        j                  ||       y )Nc                   ^    e Zd Z ej                         Zej                  Zej                  Zy)$test_to_numpy.<locals>.MyStringArrayN)	__name__
__module____qualname__r   StringDtyper	   
_dtype_clsr   _internal_fill_value r   r   MyStringArrayr0   A   s#     ^^
!uur   r8   )abc)FTF)valuesmaskr9   r;   )r   r   r!   r   r   r   r"   assert_numpy_array_equal)r8   arrr$   r'   s       r   test_to_numpyr@   >   sh    % %
 xx(rxx8L/MC \\^FxxbeeS)*H1r   )numpyr   pytestpandas.core.dtypes.commonr   pandasr   pandas._testing_testingr"   pandas.core.arraysr   ALL_INT_EA_DTYPESr!   arraysFLOAT_EA_DTYPESfixturer	   namer   r   r(   r-   r@   )r	   r9   s   00r   <module>rM      s      6   .>@>R>R	SU("((?%
0	S EGEWEW<AHBHH)7 
 v&#AQAGGLL#AB C 	 	6$&2i 
T
 $Bs   CCC 
