Ë
    ýÿæiM  ã                   óp   — d Z ddlZddlZddlmZmZmZmZ ddl	m
Z ddlmZmZ d
d„Zdd„Zddefd„Zd	„ Zy)z)
Assertion helpers for arithmetic tests.
é    N)Ú	DataFrameÚIndexÚSeriesÚarray)ÚBooleanArrayÚNumpyExtensionArrayc                 óØ   — t        j                  t        |¬«      5  | |z    ddd«       t        j                  t        |¬«      5  || z    ddd«       y# 1 sw Y   Œ3xY w# 1 sw Y   yxY w)a  
    Helper function to assert that two objects cannot be added.

    Parameters
    ----------
    left : object
        The first operand.
    right : object
        The second operand.
    msg : str, default "cannot add"
        The error message expected in the TypeError.
    ©ÚmatchN©ÚpytestÚraisesÚ	TypeError©ÚleftÚrightÚmsgs      ús/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/pandas/tests/arithmetic/common.pyÚassert_cannot_addr      sK   € ô 
�‰”y¨Ö	,ØˆuŠ÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-Ð	,÷ 
-Ð	,úç	,Ð	,ús   œAÁA ÁAÁ A)c                 ó¬  — t        j                  t        |¬«      5  | |z    ddd«       t        j                  t        |¬«      5  || z    ddd«       t        j                  t        |¬«      5  | |z
   ddd«       t        j                  t        |¬«      5  || z
   ddd«       y# 1 sw Y   Œ…xY w# 1 sw Y   ŒhxY w# 1 sw Y   ŒKxY w# 1 sw Y   yxY w)a1  
    Helper function to assert that two objects can
    neither be added nor subtracted.

    Parameters
    ----------
    left : object
        The first operand.
    right : object
        The second operand.
    msg : str or None, default None
        The error message expected in the TypeError.
    r
   Nr   r   s      r   Úassert_invalid_addsub_typer   (   s�   € ô 
�‰”y¨Ö	,ØˆuŠ÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-ä	�‰”y¨Ö	,ØˆuŠ÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-Ð	,÷ 
-Ð	,úç	,Ð	,úç	,Ð	,úç	,Ð	,ús/   œB&ÁB2Á.B>ÂC
Â&B/Â2B;Â>CÃ
CÚis_cmpc                 ón  — t        | t        «      st        |t        «      rt        S t        | t        «      st        |t        «      r(|r t        | t        «      rt        j
                  S t        S t        | t        «      st        |t        «      r|rt        j
                  S t        S t        j                  S )zÛ
    Get the box to use for 'expected' in an arithmetic or comparison operation.

    Parameters
    left : Any
    right : Any
    is_cmp : bool, default False
        Whether the operation is a comparison method.
    )Ú
isinstancer   r   r   Únpr   ÚtmÚto_array)r   r   r   s      r   Úget_upcast_boxr   @   sx   € ô �$œ	Ô"¤j°¼	Ô&BÜÐÜ�$œÔ¤:¨e´VÔ#<Ù”j ¤uÔ-ä—8‘8ˆOÜˆÜ�$œÔ¤*¨U´EÔ":ÙÜ—8‘8ˆOÜˆÜ�;‰;Ðó    c                 óR  — |t         t        fvr|nt        j                  }d„ } || |k(  «      } |t        j                  |j                  t        j
                  ¬«      «      }t        j                  ||«        ||| k(  «      }t        j                  | ||«      «        || |k7  «      }t        j                  || «        ||| k7  «      }t        j                  | || «      «       dj                  g d¢«      }t        j                  t        |¬«      5  | |k   ddd«       t        j                  t        |¬«      5  | |k   ddd«       t        j                  t        |¬«      5  | |kD   ddd«       t        j                  t        |¬«      5  | |k\   ddd«       t        j                  t        |¬«      5  || k   ddd«       t        j                  t        |¬«      5  || k   ddd«       t        j                  t        |¬«      5  || kD   ddd«       t        j                  t        |¬«      5  || k\   ddd«       y# 1 sw Y   �Œ*xY w# 1 sw Y   �ŒxY w# 1 sw Y   ŒñxY w# 1 sw Y   ŒÔxY w# 1 sw Y   Œ·xY w# 1 sw Y   ŒšxY w# 1 sw Y   Œ}xY w# 1 sw Y   yxY w)a  
    Assert that comparison operations with mismatched types behave correctly.

    Parameters
    ----------
    left : np.ndarray, ExtensionArray, Index, or Series
    right : object
    box : {pd.DataFrame, pd.Series, pd.Index, pd.array, tm.to_array}
    c                 óˆ   — t        | t        «      r| j                  S t        | t        «      r| j	                  t
        «      S | S ©N)r   r   Ú_ndarrayr   ÚastypeÚbool)Úxs    r   Úxbox2z(assert_invalid_comparison.<locals>.xbox2h   s6   € ô �aÔ,Ô-Ø—:‘:ÐÜ�aœÔ&à—8‘8œD“>Ð!Øˆr   )ÚdtypeÚ|)zInvalid comparison betweenzCannot compare typeznot supported betweenzinvalid type promotionz¿The DTypes <class 'numpy.dtype\[datetime64\]'> and <class 'numpy.dtype\[int64\]'> do not have a common DType. For example they cannot be stored in a single array unless the dtype is `object`.r
   N)r   r   r   ÚzerosÚshapeÚbool_r   Úassert_equalÚjoinr   r   r   )r   r   ÚboxÚxboxr'   ÚresultÚexpectedr   s           r   Úassert_invalid_comparisonr3   Y   sÜ  € ð œe¤U˜^Ñ+‰3´·±€Dòñ �4˜5‘=Ó!€FÙ”B—H‘H˜VŸ\™\´·±Ô:Ó;€Hä‡O�O�F˜HÔ%á�5˜D‘=Ó!€FÜ‡O�O�F™D ›NÔ+á�4˜5‘=Ó!€FÜ‡O�O�F˜X˜IÔ&á�5˜D‘=Ó!€FÜ‡O�O�F™D ( ›OÔ,à
�(‰(ò	
ó€Cô 
�‰”y¨Ö	,ØˆuŠ÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-ä	�‰”y¨Ö	,ØˆuŠ÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-ä	�‰”y¨Ö	,Ø�Š÷ 
-Ð	,÷ 
-Ñ	,úç	,Ñ	,úç	,Ð	,úç	,Ð	,úç	,Ð	,úç	,Ð	,úç	,Ð	,úç	,Ð	,ús`   ÄIÅIÅ+I!ÆI-Æ=I9Ç&JÈJÈ8JÉIÉIÉ!I*É-I6É9JÊJÊJÊJ&)z
cannot addr"   )F)Ú__doc__Únumpyr   r   Úpandasr   r   r   r   Úpandas._testingÚ_testingr   Úpandas.core.arraysr   r   r   r   r%   r   r3   © r   r   Ú<module>r;      sB   ðñó Û ÷ó õ ÷óó&ñ0¨ó ó2Er   