
    {Kg                        d dl Zd dlZd dlmZ d dlmZmZ ej                  j                  de
dge
dgedgf      d        Zej                  j                  di ej                  fd	 ej                  ej                        j                  iej                  fd	 ej                  ej                        j                  dz   iej                   fg      d
        Zej                  j                  dd ej$                  ddgej                         iej                   fd ej$                  ddgej                         ej$                  ddgej                         fiej                   fd ej$                  ddgej                         ej$                  ddgej                        fiej                  fd ej$                  ddgej&                        iej                  f ej$                  ddgej                         ej                  ej                        j                  dz   dej                   fg      d        Zej                  j                  d ej$                  g ej                          ej$                  g ej                         fddej                  f ej$                  dgej                         ddej                  f ej$                   ej                  ej                        j                  dz   gej*                        ddej                   f ej$                  dgej                        d ej                  ej                        j                  dz   dej                   f ej$                   ej                  ej                        j                  dz   gej*                        dddej                   fg      d        Zej                  j                  dd	 ej                  ej                         j                  dz   iedfd ej$                  ddgej0                        iedfdddgiedfg      d        Zy)    N)assert_array_equal)_object_dtype_isnan _smallest_admissible_index_dtypez
dtype, val   ac                     t        j                  |t         j                  gt         j                  |gg|       }t        j                  ddgddgg      }t        |      }t	        ||       y )NdtypeFT)nparraynanr   r   )r
   valXexpected_maskmasks        b/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/sklearn/utils/tests/test_fixes.pytest_object_dtype_isnanr      sV    
3-"&&#/u=AHHudmdE];<Mq!Dt]+    zparams, expected_dtypemaxvalc                 $    t        di | |k(  sJ y)zlCheck the behaviour of `smallest_admissible_index_dtype` depending only on the
    `max_val` parameter.
    N r   paramsexpected_dtypes     r   ,test_smallest_admissible_index_dtype_max_valr      s     ,5f5GGGr   arrays   r	   )r   r   c                 $    t        di | |k(  sJ y)zCheck the behaviour of `smallest_admissible_index_dtype` using the passed
    arrays but without checking the contents of the arrays.
    Nr   r   r   s     r   >test_smallest_admissible_index_dtype_without_checking_contentsr    '   s    \ ,5f5GGGr   T)r   check_contents)r   r!   r   c                 $    t        di | |k(  sJ y)zyCheck the behaviour of `smallest_admissible_index_dtype` using the dtype of the
    arrays but as well the contents.
    Nr   r   r   s     r   9test_smallest_admissible_index_dtype_by_checking_contentsr#   X   s    h ,5f5GGGr   zparams, err_type, err_msgz)is to large to be represented as np.int64z$Array dtype float64 is not supportedz#Arrays should be of type np.ndarrayc                 r    t        j                  ||      5  t        di |  ddd       y# 1 sw Y   yxY w)z-Check that we raise the proper error message.)matchNr   )pytestraisesr   )r   err_typeerr_msgs      r   *test_smallest_admissible_index_dtype_errorr*      s)    $ 
xw	/(262 
0	/	/s   -6)numpyr   r&   sklearn.utils._testingr   sklearn.utils.fixesr   r   markparametrizeobjectfloatr   int32iinfomaxint64r   r   int8r    uint32r#   
ValueErrorfloat64	TypeErrorr*   r   r   r   <module>r;      sO     5 U fc]UAJ'OP, Q, 	RXX
HBHHRXX&**	+RXX6
HBHHRXX&**Q.	/:HH  HBHHaV2884	5rxx@
 BHHaV2884BHHaV2884 HH	
 BHHaV2884BHHaV2884 HH	
 HBHHaV2773	4bhh?
 #"((Aq6:""((288,0014 HH	
;$'PHQ'PH 
 $288Bbhh7"BHH9UV"& HH	
  rxx2884MHH	
 #"((HBHHRXX$6$:$:Q$>#?ryyQ"& HH	
 #"((A3bhh7"&""((288,0014
 HH	
 #"((HBHHRXX$6$:$:Q$>#?ryyQ"&
 HH	
I,/`Ha/`H  xrxx)--127	
 xrxxAbjj9:2	

 QF	Y(MN 3! 3r   