o
    5c                     @   sv   d dl m Z mZ d dlZd dlZd dlmZ d dlm	Z	m
Z
mZmZmZ ejdd ZG dd dZG dd	 d	ZdS )
    )datetime	timedeltaN)Float64IndexIndex
Int64Index
RangeIndexUInt64Indexc                  C   s   g d} t | S )N)               
                              l           )r   )large r   ^/var/www/html/gps/gps/lib/python3.10/site-packages/pandas/tests/indexes/numeric/test_setops.pyindex_large   s   r   c                   @   s   e Zd Zejdg ddd Zdd Zejdddgd	d
 Zdd Z	dd Z
dd Zejdeg ddddfeg ddddfgdd Zdd ZdS )
TestSetOpsdtype)f8u8i8c                 C   s   t tjd|d|d}|j|ksJ t dd tdD td}||}t t||f}t	|| ||}t t||f}t	|| d S )N   r   c                 S   s   g | ]
}t  t| qS r   )r   nowr   ).0ir   r   r   
<listcomp>!   s    z5TestSetOps.test_union_non_numeric.<locals>.<listcomp>   )
r   nparanger   rangeobjectunionconcatenatetmassert_index_equal)selfr   indexotherresultexpectedr   r   r   test_union_non_numeric   s   

z!TestSetOps.test_union_non_numericc              	   C   s   t td}tg d}||}ttt|j|j}t	|| ||}ttt
t|j|j}t	|| d S )Nr   )         r   r   )r   r   r   intersectionr   sortintersect1dvaluesr#   r$   asarrayr%   r&   r'   r(   r)   r   r   r   test_intersection*   s   

zTestSetOps.test_intersectionint64uint64c                 C   sX   t g d|d}tddg}tg d}||}t|| ||}t|| d S )N)r   r,   r-   r         ?      ?)        r7   r8          @g      @)r   r   r!   r#   r$   )r%   r   r&   r'   r)   r(   r   r   r   test_int_float_union_dtype8   s   

z%TestSetOps.test_int_float_union_dtypec                 C   sT   t ddd}tddg}||}tg d}t|| ||}t|| d S )Nr   r-   )startstopr7   r8   )r9   r7   r+   r8   r:   )r   r   r!   r#   r$   r3   r   r   r   test_range_float_union_dtypeE   s   

z'TestSetOps.test_range_float_union_dtypec                 C   sH   t g d}t g d}||}t|| ||}t|| d S )N)g      ?r,   r-   )123)r   
differencer#   r$   )r%   float_indexstring_indexr(   r   r   r   test_float64_index_differenceP   s   

z(TestSetOps.test_float64_index_differencec              	   C   sv   t g d}||}t tt|j|j}t|| ||}t ttt|j|j}t|| d S )N)r	   l           r
   r   r   )	r   r.   r   r/   r0   r1   r#   r$   r2   )r%   r   r'   r(   r)   r   r   r   ,test_intersection_uint64_outside_int64_range[   s   

z7TestSetOps.test_intersection_uint64_outside_int64_rangezindex2,keeps_name)r         r   r-   r&   nameTr'   Fc                 C   sT   t g ddd}t g d}|rd|_|j||d}|d u r"| }t|| d S )N)r   r-   r,   r   r+   r&   rI   )r   r-   r   r/   )r   rJ   r.   sort_valuesr#   r$   )r%   index2
keeps_namer/   index1r)   r(   r   r   r   test_intersection_monotonicg   s   z&TestSetOps.test_intersection_monotonicc                 C   s   t g ddd}t g d}|j||d}t ddg}t||s#J |jd u s*J |d u r2| }t|| tt ||A }W d    n1 sLw   Y  t||sYJ |jd u s`J d S )N)r   r,   r-   r   rO   rI   )r,   r-   r   r+   rK   r   r+   )	r   symmetric_differencer#   equalContentsrJ   rL   r$   assert_produces_warningFutureWarning)r%   r/   rO   rM   r(   r)   r   r   r   test_symmetric_differencez   s   
z$TestSetOps.test_symmetric_differenceN)__name__
__module____qualname__pytestmarkparametrizer*   r4   r;   r>   rE   rF   r   rP   rU   r   r   r   r   r      s"    


r   c                   @   s^   e Zd Zejdededgdd Zejjddejdededgdd	 Z	dS )
TestSetOpsSortslice_Nr   c                 C   sR   t g d}|| }t||| t||| t|j|dd| d S )Nr+   r   r,   FrK   )r   r#   r$   r!   )r%   r]   idxr'   r   r   r   test_union_sort_other_special   s
   z,TestSetOpsSort.test_union_sort_other_specialzNot implemented)reasonc                 C   s>   t g d}|| }|j|dd}t g d}t|| d S )Nr^   TrK   )r   r+   r,   )r   r!   r#   r$   )r%   r]   r_   r'   r(   r)   r   r   r   test_union_sort_special_true   s
   z+TestSetOpsSort.test_union_sort_special_true)
rV   rW   rX   rY   rZ   r[   slicer`   xfailrb   r   r   r   r   r\      s    
r\   )r   r   numpyr   rY   pandas._testing_testingr#   pandas.core.indexes.apir   r   r   r   r   fixturer   r   r\   r   r   r   r   <module>   s    	
s