o
    ?Hh*                     @   s   d dl Zd dlmZmZmZ d dlmZmZm	Z	m
Z
 d dlZdd Zdd Zdd	 Zd
d Zdd Zdd Zdd Zdd Zejdddgddggdd ZdS )    N)assert_equalassert_almost_equalassert_allclose)boxcoxboxcox1p
inv_boxcoxinv_boxcox1pc                  C   s   t g d} t| d}t|t |  t| d}t|| d  t| d}t|d| d d   t g d}td|}t|d|  d S )N)      ?         r   r
   r   r	   r	   r
   r         )nparrayr   r   logxylam r   _/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/scipy/special/tests/test_boxcox.pytest_boxcox_basic	   s   



r   c                  C   s*   d} d}t | |}t|t| dd d S )Ng     ?P7xf +=rtol)r   r   r   r   r   lmbdar   r   r   r   test_boxcox_underflow   s   
r   c                  C   sj   t g d} t| g d}t|t t jt jt jg d} t| ddg}t|t t j t j g d S )N)r    g      ࿩r	          @      r         )r   r   r   r   naninfr   r   r   r   r   test_boxcox_nonfinite$       r(   c                  C   s   t g d} t| d}t|t |  t| d}t||  t| d}t|d|  d|    t g d}td|}t|d|  d S )	N)g      пg#Bǻr   g#B;g      ?r
      r   r
   r   r	   r   r    r   )r   r   r   r   log1pr   r   r   r   test_boxcox1p_basic0   s   




r,   c                  C   s>   t ddg} t ddg}t| |}t|t | dd d S )NV瞯<r   gC]r2<r   r   )r   r   r   r   r+   r   r   r   r   test_boxcox1p_underflowE   s   
r.   c                  C   sj   t g d} t| g d}t|t t jt jt jg d} t| ddg}t|t t j t j g d S )N)r/   r#   r!   r    r$   r   )r   r   r   r   r%   r&   r'   r   r   r   test_boxcox1p_nonfiniteL   r)   r0   c                  C   sx   t g d} t g d}t| |}t||}t| | t g d} t g d}t| |}t||}t| | d S )N)g        g      ?r"   )r   r   r   r   r   r   r   )r   r   r   x2r   r   r   test_inv_boxcoxX   s   




r2   c                  C   s$   d} d}t | |}t|| dd d S )Nr-   r   r   r   )r   r   )r   r   r   r   r   r   test_inv_boxcox1p_underflowf   s   
r3   zx, lmbd      g{Gz?iec                 C   sd   t | |}t|sJ t||}t| | t| d |}t|s$J t||}t| d | d S )Nr
   )r   r   isfiniter   r   r   r   )r   lmbr   x_invy1px1p_invr   r   r   test_boxcox_premature_overflowm   s   



r;   )numpyr   numpy.testingr   r   r   scipy.specialr   r   r   r   pytestr   r   r(   r,   r.   r0   r2   r3   markparametrizer;   r   r   r   r   <module>   s&    