o
    _~#g                     @   sT  d dl Zd dlZd dlmZmZmZmZmZm	Z	 d dl
mZ d dlmZmZ d dlmZ d dlmZ dd Zejjdejejejejejejejejejej ej!ej"ej#ej$ej%ej&ej'ej(ej)ej*ej+ej,gd	d
 ddd Z-ejjdej.ej/ej0ej1gdd
 ddd Z2ejdej3ej4gdd Z5ejdej6ej7ej8gdd Z9dS )    N)CategoricalIndexDatetimeIndexIndexPeriodIndexTimedeltaIndexisna)is_complex_dtypeis_numeric_dtype)BooleanArray)DatetimeIndexOpsMixinc                 C   sr   | | k}t j| jtd}t j| | |d t|| | js7t j| jtd}t j| j| j|d t|| d S d S )Ndtypeout)	npemptyshapeboolequaltmassert_numpy_array_equal	_is_multiarray)indexresultr    r   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/pandas/tests/indexes/test_numpy_compat.pytest_numpy_ufuncs_out   s   r   funcc                 C      | j S N__name__xr   r   r   <lambda>=       r%   )idsc              	   C   s,  t | trAtttf+ tjdd ||  W d    n1 s"w   Y  W d    d S W d    d S 1 s:w   Y  d S t| rt	| rQ|tj
tjfv stjdd$ || }|| j}|jtjkrm|tj}t|| jd}W d    n1 s~w   Y  t|| t | jtjrt| rt	| r|j| jksJ d S | jdv r|jdv sJ d S | jdv r|jdksJ d S |jdksJ d S t|tu sJ d S t| d	krd S tttf+ tjdd ||  W d    n1 sw   Y  W d    d S W d    d S 1 sw   Y  d S )
Nignore)all)name)r   int8uint8)float16float32)int16uint16r.   r.   float64r   )
isinstancer   r   external_error_raised	TypeErrorAttributeErrorr   errstater	   r   deg2radrad2degvaluesr   r-   astyper.   r   r*   assert_index_equaltypelen)r   r   r   
arr_resultexpr   r   r   test_numpy_ufuncs_basic#   sL   
 
"



$r@   c                 C   r   r    r!   r#   r   r   r   r%   i   r&   c                 C   s  t | ttfrO|tjtjtjfv r3|| }t |tjsJ tj| j	t
d}|| |d t|| d S tt ||  W d    d S 1 sHw   Y  d S t | trptt ||  W d    d S 1 siw   Y  d S t| rt| r}|tju s|| }t | jtjst |tsJ nt |tjsJ tj| j	t
d}|| |d t | jtjst||j d S t|| d S t| dkrd S tt ||  W d    d S 1 sw   Y  d S )Nr   r   r   )r2   r   r   r   isfiniteisinfisnanndarrayr   r   r   r   r   r3   r4   r   r	   r   signbitr   r
   _datar=   )r   r   r   r   r   r   r   test_numpy_ufuncs_otherh   s@   
"

"

"rG   c                 C   s   t | dkrtd t| tr5| jjdu r5tjtdd |	|  W d    d S 1 s.w   Y  d S |	| }|t
ju rF| jdd}n| jdd}t|t|u sVJ t|rbt|s`J d S ||kshJ d S )Nr   z(Test doesn't make sense for empty index.Fzis not ordered for)match)skipna)r=   pytestskipr2   r   r   orderedraisesr4   reducer   maximummaxminr<   r   )r   r   requestr   expectedr   r   r   test_numpy_ufuncs_reductions   s"   



rT   c                 C   sv   t g ddd}t g ddd}td  | ||}W d    n1 s%w   Y  t | |j|j}t|| d S )N)            int64r   )rW   rX         )r   r   assert_produces_warningr9   r;   )r   idx1idx2r   rS   r   r   r   test_numpy_ufuncs_bitwise   s   r_   ):numpyr   rJ   pandasr   r   r   r   r   r   pandas._testing_testingr   pandas.api.typesr   r	   pandas.core.arraysr
    pandas.core.indexes.datetimeliker   r   markparametrizer?   exp2expm1loglog2log10log1psqrtsincostanarcsinarccosarctansinhcoshtanharcsinharccosharctanhr7   r8   r@   rA   rB   rC   rE   rG   rO   minimumrT   bitwise_and
bitwise_orbitwise_xorr_   r   r   r   r   <module>   sX     
)
.
