
    i                         d dl Zd dlZd dlmZmZmZmZmZ d dl	m
Z d dlmZ ej                  j                  d      Zej                  j#                  dd d g      d        Zd	 Zd
 Zd Zy)    N)Series	TimedeltaTimedeltaIndexarraytimedelta_range)	get_arrayz.ignore:Setting a value on a view:FutureWarningconsc                     t        |       S Nr   xs    m/app/cer_product_mecsu/.venv/lib/python3.12/site-packages/pandas/tests/copy_view/index/test_timedeltaindex.py<lambda>r      s    .#     c                 *    t        t        |             S r   r   r   s    r   r   r      s    .!23 r   c                     t        dd      }t        |      } | |      }|j                  d      }t        d      |j                  d<   t        j                  ||       y )Nz1 day   )periodsT)deepz5 daysr   )r   r   copyr   iloctmassert_index_equal)r	   dtseridxexpecteds        r   test_timedeltaindexr      sT     
!	,B
*C
s)CxxTx"HH%CHHQK#x(r   c                      t        j                  ddgd      } t        |       }t        j                  | t	        |            rJ y N      timedelta64[ns]dtype)npr   r   shares_memoryr   arrr   s     r   5test_constructor_copy_input_timedelta_ndarray_defaultr+   #   s>    
((Aq6!2
3C

CYs^4444r   c                  |    t        ddgd      } t        |       }t        j                  | |j                         rJ y r!   )r   r   r   r(   r)   s     r   0test_constructor_copy_input_timedelta_ea_defaultr-   *   s:    
A/
0C

CSYY////r   c                  f   t        j                  ddgd      } d| j                  _        t	        t        |             }t        j                  | t        |            rJ t        d      |j                  d<   t	        t        d      t        d      gd      }t        j                  ||       y )	Nr"   r#   r$   r%   F)daysr   )nanoseconds)r'   r   flags	writeabler   r   r(   r   r   r   r   assert_series_equal)r*   r   r   s      r   7test_series_from_temporary_timedeltaindex_readonly_datar4   1   s    
((Aq6!2
3CCII
$
%CYs^444#CHHQK		I!45=NH 3)r   )numpyr'   pytestpandasr   r   r   r   r   pandas._testing_testingr   pandas.tests.copy_view.utilr   markfilterwarnings
pytestmarkparametrizer   r+   r-   r4    r   r   <module>r@      st        1[[''4

 
#3))50
*r   