o
    _~#g                     @   s   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 ejeegddd Zejeded	fed
ed	fdgdd ddd ZG dd dZdS )zHTests for Interval-Interval operations, such as overlaps, contains, etc.    N)IntervalIntervalIndex	Timedelta	Timestamp)IntervalArray)paramsc                 C      | j S )z>
    Fixture for testing both interval container classes.
    paramrequest r   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/pandas/tests/arrays/interval/test_overlaps.pyconstructor   s   r   z0 days1 day
2018-01-01)r      c                 C   s   t | d jS )Nr   type__name__xr   r   r   <lambda>   s    r   )r   idsc                 C   r   )z
    Fixture for generating intervals of different types from a start value
    and a shift value that can be added to start to generate an endpoint.
    r	   r   r   r   r   start_shift   s   r   c                   @   sf   e Zd Zdd Zejdeegdd Z	dd Z
ejjdd	d
dededgdd ddd ZdS )TestOverlapsc              	   C   s   |\}}t ||d|  |}||d|  f|| |d|  f|| |d|  f|d|  |d|  f|d|  |d|  f|d|  |d|  fg}|||}	|joU|	j}
tdddd|
dg}|	|}t|| d S )N            TF)	r   from_tuplesclosed_rightclosed_leftnparrayoverlapstmassert_numpy_array_equal)selfr   r   closedother_closedstartshiftintervaltuplesinterval_containeradjacentexpectedresultr   r   r   test_overlaps_interval(   s   
z#TestOverlaps.test_overlaps_intervalother_constructorc                 C   sZ   | td}| td}tjtdd || W d    d S 1 s&w   Y  d S )Nr   z^$match)from_breaksrangepytestraisesNotImplementedErrorr%   )r(   r   r4   r/   other_containerr   r   r    test_overlaps_interval_container<   s
   "z-TestOverlaps.test_overlaps_interval_containerc           
      C   sp   |\}}t ||| }||| ftj|d|  |d|  fg}||}tg d}||}	t|	| dS )zNA values are marked as Falser   r   )TFFN)r   r#   nanr    r$   r%   r&   r'   )
r(   r   r   r+   r,   r-   r.   r/   r1   r2   r   r   r   test_overlaps_naD   s   


zTestOverlaps.test_overlaps_naother
   Tfoor   r   c                 C   s
   t | jS )Nr   r   r   r   r   r   W   s   
 zTestOverlaps.<lambda>)r   c                 C   s\   | td}dt|j }tjt|d || W d    d S 1 s'w   Y  d S )Nr   z#`other` must be Interval-like, got r5   )r7   r8   r   r   r9   r:   	TypeErrorr%   )r(   r   r@   r/   msgr   r   r   test_overlaps_invalid_typeT   s
   "z'TestOverlaps.test_overlaps_invalid_typeN)r   
__module____qualname__r3   r9   markparametrizer   r   r=   r?   r   r   rE   r   r   r   r   r   '   s    
r   )__doc__numpyr#   r9   pandasr   r   r   r   pandas._testing_testingr&   pandas.core.arraysr   fixturer   r   r   r   r   r   r   <module>   s"    

