a
    Qe                     @   s^   d dl Zd dlmZ d dlZd dlmZmZm	Z	 G dd dZ
G dd dZG dd dZdS )	    N)assert_allcloseassert_array_equalsuppress_warningsc                   @   s`   e Zd Zdd Zdd Zdd Zejde	j
dd	fd
e	j
d	fd
de	j
fgdd Zdd ZdS )TestBdtrc                 C   s   t ddd}t|d d S Nr            ?)scbdtrr   selfval r   Q/var/www/sunrise/env/lib/python3.9/site-packages/scipy/special/tests/test_bdtr.pytest   s    zTestBdtr.testc                 C   s$   t g ddd}t|g d d S )Nr   r      r   r   )      ?      ?      ?r	   r
   r   r   r   r   r   test_sum_is_one   s    zTestBdtr.test_sum_is_onec                 C   s2   t g ddd}t g ddd}t|| d S N)皙?皙? @r   r   r   r   r   Z
double_valZint_valr   r   r   test_rounding   s    zTestBdtr.test_roundingk, n, pr   r   r   c                 C   sP   t  (}|t t|||}W d    n1 s40    Y  t|sLJ d S N)r   filterDeprecationWarningr	   r
   npisnanr   knpsupr   r   r   r   test_inf   s    
,zTestBdtr.test_infc                 C   s    t ddd}t|sJ d S )N皙r   r   )r	   r
   r"   r#   r   r   r   r   test_domain    s    zTestBdtr.test_domainN)__name__
__module____qualname__r   r   r   pytestmarkparametrizer"   infr)   r+   r   r   r   r   r      s   



r   c                   @   sh   e Zd Zdd Zdd Zdd Zejde	j
dd	fd
e	j
d	fd
de	j
fgdd Zdd Zdd ZdS )	TestBdtrcc                 C   s   t ddd}t|d d S r   )r	   bdtrcr   r   r   r   r   
test_value&   s    zTestBdtrc.test_valuec                 C   s$   t g ddd}t|g d d S )Nr   r   r   )r   r   g        r	   r4   r   r   r   r   r   r   *   s    zTestBdtrc.test_sum_is_onec                 C   s2   t g ddd}t g ddd}t|| d S r   r6   r   r   r   r   r   .   s    zTestBdtrc.test_roundingr   r   r   r   c                 C   sP   t  (}|t t|||}W d    n1 s40    Y  t|sLJ d S r   )r   r    r!   r	   r4   r"   r#   r$   r   r   r   r)   3   s    
,zTestBdtrc.test_infc                 C   s8   t ddd}t ddd}t|s*J t|d d S )Nr*   r   r   r   r   )r	   r4   r"   r#   r   )r   r   Zval2r   r   r   r+   >   s    zTestBdtrc.test_domainc                 C   s>   t g ddd}t g ddd}|| }t|g d d S )Nr   r   r   )r   r   r   )r	   r
   r4   r   )r   	bdtr_valsZ
bdtrc_valsvalsr   r   r   test_bdtr_bdtrc_sum_to_oneD   s    z$TestBdtrc.test_bdtr_bdtrc_sum_to_oneN)r,   r-   r.   r5   r   r   r/   r0   r1   r"   r2   r)   r+   r9   r   r   r   r   r3   %   s   



r3   c                   @   sz   e Zd Zdd Zdd Zdd Zejde	j
dd	fd
e	j
d	fd
de	j
fgdd Zejdddgdd Zdd ZdS )	TestBdtric                 C   s   t ddd}t|d d S r   r	   bdtrir   r   r   r   r   r5   L   s    zTestBdtri.test_valuec                 C   sF   t ddgdd}tddtd  dtd g}t|| d S )Nr   r   r   r   )r	   r<   r"   Zasarraysqrtr   )r   r   actualr   r   r   r   P   s    &zTestBdtri.test_sum_is_onec                 C   s2   t ddgdd}t ddgdd}t|| d S )Nr   r   r   r   r   r   r;   r   r   r   r   r   U   s    zTestBdtri.test_roundingr   r   r   r   c                 C   sP   t  (}|t t|||}W d    n1 s40    Y  t|sLJ d S r   )r   r    r!   r	   r<   r"   r#   r$   r   r   r   r)   Z   s    
,zTestBdtri.test_inf)r*   r   r   )r   r   r   c                 C   s    t |||}t|sJ d S r   )r	   r<   r"   r#   )r   r%   r&   r'   r   r   r   r   r+   e   s    zTestBdtri.test_domainc                 C   s:   t g ddd}t g dd|}t|ddtjg d S )Nr   r   r   )r	   r
   r<   r   r"   nan)r   r7   Zroundtrip_valsr   r   r   test_bdtr_bdtri_roundtripm   s    z#TestBdtri.test_bdtr_bdtri_roundtripN)r,   r-   r.   r5   r   r   r/   r0   r1   r"   r2   r)   r+   r@   r   r   r   r   r:   K   s   




r:   )numpyr"   Zscipy.specialZspecialr	   r/   Znumpy.testingr   r   r   r   r3   r:   r   r   r   r   <module>   s   &