
    >h	                         S r SSKJr  SSKJr  SSKrSSKJr  / SQr	S r
\
" S\	5      r\
" S\	5      r " S	 S
5      rSS jrg)z0assert functions from numpy and pandas testing

    )testingNBunch)paramsbsetvaluespvaluesc                 0   ^ ^  " U U4S jS[         5      nU$ )ay  
Generates a special purpose Bunch class

Parameters
----------
attribute: str
    Attribute to access when splitting
columns: List[str]
    List of names to use when splitting the columns of attribute

Notes
-----
After the class is initialized as a Bunch, the columne of attribute
are split so that Bunch has the keys in columns and
bunch[column[i]] = bunch[attribute][:, i]
c                   .   >^  \ rS rSrU UU4S jrSrU =r$ )#bunch_factory.<locals>.FactoryBunch    c                    > [         TU ]  " U0 UD6  [        U T5      (       d  [        SR	                  T5      5      e[        T5       H  u  p4[        U T5      S S 2U4   X'   M     g )Nz4{} is required and must be passed to the constructor)super__init__hasattrAttributeErrorformat	enumerategetattr)selfargskwargsiatt	__class__	attributecolumnss        lC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\statsmodels/tools/testing.pyr   ,bunch_factory.<locals>.FactoryBunch.__init__!   sh    Gd-f-4++$ &77=vi7HJ J#G,#D)4QT:	 -     )__name__
__module____qualname____firstlineno__r   __static_attributes____classcell__)r   r   r   s   @r   FactoryBunchr       s    	; 	;r    r(   r   )r   r   r(   s   `` r   bunch_factoryr)      s    "; ;u ; r    params_tablemargins_tablec                   *    \ rS rSrSrS rS rS rSrg)Holder1   z>
Test-focused class to simplify accessing values by attribute
c                 :    U R                   R                  U5        g )N)__dict__update)r   kwdss     r   r   Holder.__init__5   s    T"r    c                 d    SR                  S [        U 5      R                  5        5       5      nU$ )N
c              3   z   #    U  H1  u  p[        U5      S -   [        U5      R                  SS5      -   v   M3     g7fz = r5   z
    N)strreplace.0kvs      r   	<genexpr>!Holder.__str__.<locals>.<genexpr>9   s5      7#541 1v~AtX(FF#5   9;)joinvarsitemsr   sss     r   __str__Holder.__str__8   s/    YY 7#':#3#3#57 7	r    c                     SR                  S [        U 5      R                  5        5       5      n[        U R                  5      S-   U-   nU$ )Nr5   c              3   z   #    U  H1  u  p[        U5      S -   [        U5      R                  SS5      -   v   M3     g7fr7   )r8   reprr9   r:   s      r   r>   "Holder.__repr__.<locals>.<genexpr>?   s5      7#541 1v~Qh(GG#5r@   )rA   rB   rC   r8   r   rD   s     r   __repr__Holder.__repr__=   sG    YY 7#':#3#3#57 7 4'",	r    r!   N)	r"   r#   r$   r%   __doc__r   rF   rL   r&   r!   r    r   r-   r-   1   s    #
r    r-   c                 x   [        U[        R                  5      (       a  [        R                  " X5        g [        U[        R
                  5      (       a  [        R                  " X40 UD6  g [        U[        R                  5      (       a  [        R                  " X40 UD6  g [        R                  " XSSS9  g )N T)err_msgverbose)
isinstancepandasIndexpdtassert_index_equalSeriesassert_series_equal	DataFrameassert_frame_equalnptassert_equal)actualdesiredrQ   rR   r2   s        r   r]   r]   G   s}    '6<<((v/	GV]]	+	+848	GV--	.	.v7$7"dCr    )rP   T)rN   statsmodels.compat.pandasr   rV   numpy.testingr\   rT   statsmodels.tools.toolsr   
PARAM_LISTr)   ParamsTableTestBunchMarginTableTestBunchr-   r]   r!   r    r   <module>rf      sP    5   ) 5
: %^Z@ $_jA  ,Dr    