
    Owg                         d dl mZ d dlZd dlZd dlZd dlmc mc m	Z
 d dlmZ d dlmZ d Z e       Z ej$                  ed   ed         d        Zd	 Zd
 Zy)    )partialN)Seriesc                     dt         j                  fdt         j                  fgdD  cg c]#  } d|  dt        t         j                  |       f% c} z   dt         j
                  fdt         j                  fd	t         j                  fd
t         j                  fdt         j                  fgz   dD cg c]<  }t         j                  D ]'  }d| d| dt        t         j                  ||      f) > c}}z   dD cg c]U  }t         j                  j                         D ]2  }dD ]+  }d| d| d| dt        t         j                  |||      f- 4 W c}}}z   }t        t!        |       }|d   |d   dS c c} w c c}}w c c}}}w )Nroll_sum	roll_mean)r      z	roll_var())ddof	roll_skew	roll_kurtroll_median_croll_maxroll_min)g-C6?g      ?gH.?zroll_quantile(,)quantileinterpolation)TFz
roll_rank()
percentilemethod	ascendingr   r   )idsparams)window_aggregationsr   r   r   roll_varr   r   r   r   r   interpolation_typesroll_quantilerolling_rank_tiebreakerskeys	roll_ranklistzip)r
   r   r   r   r   r   named_roll_aggsunzippeds           c/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/tests/window/test_cython_aggregations.py_get_rolling_aggregationsr$      s    ,556-778	
 
 a '*=*F*FT"RS
		
 -778-7781??@,556,556
	
0 2
 !4!H!H
  !
!M?!<'55%"/

	
J ,
 
 -FFKKM
 *
  ZL&9+Q?'11)!'	


7(	
 X C)*HA;(1+66Q


s   (E:1AE?=AF
r   r   )r   r   c                     | j                   S )z/Make a rolling aggregation function as fixture.)param)requests    r#   rolling_aggregationr(   E   s    
 ==    c                    ddddddgf\  }}}}}t        j                  dd|z   t         j                        }t        j                  |||t         j                        }||z
  }t        j                  |t         j
                        }	t         | |||	   ||	   |            }
t         | ||||      |	         }t        j                  ||
       y )Nr   r               dtype)	nparangefloat64int64arrayint32r   tmassert_equal)r(   minpstepwidthsize	selectionvaluesendstartselarrresultexpecteds               r#   -test_rolling_aggregation_boundary_consistencyrD   M   s    )*Aq"q!f)<&D$tYYYq!d("**5F
))E4RXX
6C%KEXXirxx0F'fs6{DQRF)&%dCFKLHOOHf%r)   c                 0   d\  }}d|z  dz   }t        j                  d|dz   t         j                        }t        j                  j
                  |||dz    t         j                  ||dz   <   t        j                  j                  ||dz   |dz    t        j                  d||z
  gt         j                        }t        j                  ||gt         j                        }t        j                  t        t        |            D cg c]  }t        ||   ||         D ]  }|  c}}t         j                        }	t         | ||||            }
t        j                  ||	   t         j                        }t        j                  dt        |      |z  |t         j                        }||z   }t         | ||||            }t        j                  |j                        j!                         sJ d       t#        j$                  ||
       y c c}}w )	N)r      r-   rF   r   r/   r+   r   z"Not all expected values are finite)r1   r2   r3   sys
float_infominnanmaxr5   r4   rangelenr6   r   isfiniter>   allr7   r8   )r(   r9   r;   r<   r>   r@   r?   ijlocrB   compact_valuescompact_startcompact_endrC   s                  r#   -test_rolling_aggregation_with_unused_elementsrV   Y   s   KD%u9q=DYYq$("**5F # 2 2F5519F519$'NN$6$6F519uqy!HHa&bhh7E
((E4=
1C
((#e*%GquU1Xs1v/FG!GGhhC 'sDABFXXfSk<NIIaUe!3U"((KM%'KNM;MH ;;x'++-S/SS-OOHf% 	Hs    H
)	functoolsr   rG   numpyr1   pytest pandas._libs.window.aggregations_libswindowaggregationsr   pandasr   pandas._testing_testingr7   r$   _rolling_aggregationsfixturer(   rD   rV    r)   r#   <module>rd      sg     
   > >  27j 23   *0Ee0L
	&&r)   