o
    ?Hh                     @   s  d dl Zd dlZd dlmZ d dlmZmZ ej	de
dge
dgedgfdd Zej	d	i ejfd
eejjiejfd
eejjd iejfgdd Zej	d	dejddgejdiejfdejddgejdejddgejdfiejfdejddgejdejddgejdfiejfdejddgejdiejfejddgejdeejjd dejfgdd Zej	d	ejg ejdejg ejdfddejfejdgejdddejfejeejjd gejdddejfejdgejddeejjd dejfejeejjd gejddddejfgdd Zej	dd
eejjd iedfdejddgejdiedfdddgiedfgdd ZdS )    N)assert_array_equal)_object_dtype_isnan _smallest_admissible_index_dtypez
dtype, val   ac                 C   sJ   t j|t jgt j|gg| d}t ddgddgg}t|}t|| d S )NdtypeFT)nparraynanr   r   )r   valXexpected_maskmask r   ^/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/sklearn/utils/tests/test_fixes.pytest_object_dtype_isnan   s   r   zparams, expected_dtypemaxvalc                 C      t di | |ksJ dS )zlCheck the behaviour of `smallest_admissible_index_dtype` depending only on the
    `max_val` parameter.
    Nr   r   paramsexpected_dtyper   r   r   ,test_smallest_admissible_index_dtype_max_val   s   r   arrays   r   )r   r   c                 C   r   )zCheck the behaviour of `smallest_admissible_index_dtype` using the passed
    arrays but without checking the contents of the arrays.
    Nr   r   r   r   r   r   >test_smallest_admissible_index_dtype_without_checking_contents%   s   .r   T)r   check_contents)r   r   r   c                 C   r   )zyCheck the behaviour of `smallest_admissible_index_dtype` using the dtype of the
    arrays but as well the contents.
    Nr   r   r   r   r   r   9test_smallest_admissible_index_dtype_by_checking_contentsV   s   4r   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                 C   sB   t j||d tdi |  W d   dS 1 sw   Y  dS )z-Check that we raise the proper error message.)matchNr   )pytestraisesr   )r   err_typeerr_msgr   r   r   *test_smallest_admissible_index_dtype_error   s   "r$   )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   r   <module>   s   




(	

0