
    Q3je              	       \   d dl Zd dlZd dlmZmZ d dlmZ ej                  j                  dddg dfddg df ej                  g d      dg dfg      d	        Zd
 Zej                  j                  dg d      d        Zej                  j                  dddg ddfg      d        Zy)    N)_check_feature_names_get_feature_index)_convert_containerz1feature_names, array_type, expected_feature_namesarray)x0x1x2pandasabcc                     t         j                  j                  dd      }g d}t        |||      }t	        ||       }||k(  sJ y )N
      r   )constructor_namecolumn_names)nprandomrandnr   r   )feature_names
array_typeexpected_feature_namesXr   feature_names_validateds         S/DATA/.local/lib/python3.12/site-packages/sklearn/inspection/tests/test_pd_utils.pytest_check_feature_namesr      sG     			AA"L1zUA21mD"&<<<<    c                      t         j                  j                  dd      } g d}d}t        j                  t
        |      5  t        | |       d d d        y # 1 sw Y   y xY w)Nr   r   )r   r   r   r   z,feature_names should not contain duplicates.match)r   r   r   pytestraises
ValueErrorr   )r   r   msgs      r   test_check_feature_names_errorr&      sD    
		AA(M
8C	z	-Q. 
.	-	-s   AA!zfx, idx))r   r   )   r'   )r   r   )r   r'   )r      c                 .    g d}t        | |      |k(  sJ y )Nr   )r   )fxidxr   s      r   test_get_feature_indexr,       s    #Mb-0C777r   zfx, feature_names, err_msg)r   Nz.Cannot plot partial dependence for feature 'a'dz Feature 'd' not in feature_namesc                 |    t        j                  t        |      5  t        | |       d d d        y # 1 sw Y   y xY w)Nr    )r"   r#   r$   r   )r*   r   err_msgs      r   test_get_feature_names_errorr0   &   s(     
z	12}- 
2	1	1s   2;)numpyr   r"   sklearn.inspection._pd_utilsr   r   sklearn.utils._testingr   markparametrizer   r   r&   r,   r0    r   r   <module>r7      s      Q 5 7	w*+	x)	/	"G_===/ $RS8 T8
  E	oAB..r   