HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/pandas/tests/window/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/pandas/tests/window/__pycache__/test_numba.cpython-36.pyc
3

���h~�@s�ddlZddlZddljjZddlmZm	Z	ddl
jZddl
mZejdd�ejjd�Gdd�d���Zejdd�d	d
��ZdS)�N)�Series�option_context)�NUMBA_FUNC_CACHE�numbaz0.46.0zignore:\nThe keyword argumentc@s@eZdZejjdddg�dd��Zejjdddg�dd��ZdS)	�	TestApply�jitTFc
Cs�dd�}|rddl}|j|�}|||d�}d
}	ttd��}
|
jd|d�j||	d|d	d
�}|
jd|d�j|d|	d	d�}tj||�dS)NcWs(d}x|D]}||7}q
Wtj|�|S)Nr)�np�mean)�x�argsZarg_sum�arg�r
�@/tmp/pip-build-5_djhm0z/pandas/pandas/tests/window/test_numba.py�fs
z)TestApply.test_numba_vs_cython.<locals>.fr)�nogil�parallel�nopython��
)�centerrT)r�engine�
engine_kwargs�raw�cython)rrr)r)rrr�range�rolling�apply�tm�assert_series_equal)
�selfrrrrrrrrr�s�result�expectedr
r
r�test_numba_vs_cythons
zTestApply.test_numba_vs_cythoncCs�dd�}dd�}|r0ddl}|j|�}|j|�}|||d�}ttd��jd�}	|	j|d	|d
d�}
|	j|dd
d
�}tj|
|�|dftks�t	�|	j|d	|d
d�}
|	j|dd
d
�}tj|
|�|	j|d	|d
d�}
|	j|dd
d
�}tj|
|�dS)NcSstj|�dS)N�)rr	)r
r
r
r�func_1+sz$TestApply.test_cache.<locals>.func_1cSstj|�dS)N�)rZstd)r
r
r
r�func_2.sz$TestApply.test_cache.<locals>.func_2r)rrrrrrT)rrrr)rrZ
rolling_apply)
rrrrrrrrr�AssertionError)rrrrrr%r'rrZrollr!r"r
r
r�
test_cache(s*

zTestApply.test_cacheN)�__name__�
__module__�__qualname__�pytest�markZparametrizer#r)r
r
r
rrsrcCsfdd�}ttd��}tdd��|jd�j|ddd�}WdQRX|jd�j|ddd�}tj||�dS)	NcSstj|�dS)Nr)rr	)r
r
r
rrRsz!test_use_global_config.<locals>.frzcompute.use_numbaTr)rrr)rrrrrrr)rr r!r"r
r
r�test_use_global_configPs r/)Znumpyrr-Zpandas.util._test_decorators�utilZ_test_decorators�tdZpandasrrZpandas._testingZ_testingrZpandas.core.util.numba_rZ
skip_if_nor.�filterwarningsrr/r
r
r
r�<module>s

D