
    [6g[
                     P    d dl Zd dlZd dlZd dlmZ d dlmZ  G d d          Z	dS )    N)Seriesc                       e Zd Zd Zd Zd Zd Zej        	                    dg d          ej        	                    dg d          d	                         Z
d
 ZdS )TestSeriesRoundc                     d|j         _        |                    d          }t          t	          j        |j        d          |j         d          }t          j        ||           |j        |j        k    sJ d S )N
index_name   ts)indexname)r
   r   roundr   npvaluestmassert_series_equal)selfdatetime_seriesresultexpecteds       e/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/pandas/tests/series/methods/test_round.py
test_roundzTestSeriesRound.test_round
   s    %1" &&q))H_+Q//7LSW
 
 
 	vx000{o2222222    c                 B   t          g d|          }t          j        |d          }t          g d|          }t          j        ||           d}t          j        t          |          5  t          j        |d|           d d d            d S # 1 swxY w Y   d S )	N){Gz?g(\?Q?dtyper   )decimals)       @      ?        z$the 'out' parameter is not supported)match)r   out)r   r   r   r   r   pytestraises
ValueError)r   any_float_dtypeserr"   r   msgs         r   test_round_numpyz TestSeriesRound.test_round_numpy   s    '''???hsQ'''///AAA
sH---4]:S111 	/ 	/HS1#....	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s   /BBBc                 (   t          dt          j        dg|          }t          j        d           5  |                                }d d d            n# 1 swxY w Y   t          dt          j        dg|          }t          j        ||           d S )Nr   r   r   r   r    )r   r   nanr   assert_produces_warningr   r   )r   r&   r'   r   r   s        r   test_round_numpy_with_nanz)TestSeriesRound.test_round_numpy_with_nan   s    dBFD)AAA'-- 	! 	!YY[[F	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!3,ODDD
vx00000s   AAAc                 b   t          g dt          d          |          }t          |          }t          g dt          d          |          }t          j        ||           d}t          g dt          d          |          }t          ||          }t          j        ||           d S )N)g+?gCl @gCl@   )r
   r   )r   r   g      @r   )gQ?g(\ @g(\@)r   ranger   r   r   )r   r&   r'   r   expected_rounded0r   expected_roundeds          r   test_round_builtinz"TestSeriesRound.test_round_builtin&   s    !!!((!
 
 

 s"OO588?
 
 
 	v'8999!eAhho
 
 
 sH%%
v'788888r   method)r   floorceilfreq)s5smin5minh5hc                     t          t          j        gd| d          }t          t          j        d| d          }t          |j        |          } ||          }t          j        ||           d S )NzM8[]r   )r   pdNaTgetattrdtr   r   )r   r4   r7   unitr'   r   round_methodr   s           r   test_round_natzTestSeriesRound.test_round_nat9   sw     bfX]4]]]333"&d666svv..d##
vx00000r   c                     t          ddgd          }|                                }|                    d          }t          j        ||           d|j        d<   t          j        ||           d S )NTFbooleanr   r   r   )r   copyr   r   r   iloc)r   r'   r   r   s       r   test_round_ea_booleanz%TestSeriesRound.test_round_ea_booleanC   sk    dE])44488::1
vx000A
sH-----r   N)__name__
__module____qualname__r   r)   r-   r3   r#   markparametrizerF   rK    r   r   r   r   	   s        3 3 3	/ 	/ 	/1 1 19 9 9& [X'A'A'ABB[V%J%J%JKK1 1 LK CB1. . . . .r   r   )
numpyr   r#   pandasr@   r   pandas._testing_testingr   r   rQ   r   r   <module>rV      s                        A. A. A. A. A. A. A. A. A. A.r   