
ʽXc           @` s   d  d l  m Z m Z m Z d  d l Z d  d l m Z m Z m	 Z	 m
 Z
 d  d l m Z m Z m Z m Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z e d k r e   n  d S(   i    (   t   divisiont   print_functiont   absolute_importN(   t   run_module_suitet   assert_equalt   assert_almost_equalt   assert_allclose(   t   boxcoxt   boxcox1pt
   inv_boxcoxt   inv_boxcox1pc          c` s   t  j d d d d g  }  t |  d  } t | t  j |   f Vt |  d  } t | |  d f Vt |  d  } t | d |  d d f Vt  j d d d g  } t d |  } t | d | f Vd  S(   Ng      ?i   i   i   i    g      (   t   npt   arrayR   R   t   log(   t   xt   yt   lam(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_boxcox_basic
   s    c          C` s;   d }  d } t  |  |  } t | t j |   d d d  S(   Ni   gV瞯<gP7xf t   rtolg+=g     ?(   R   R   R   R   (   R   t   lmbdaR   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_boxcox_underflow   s    c          c` s   t  j d d d g  }  t |  d d d g  } t | t  j t  j t  j t  j g  f Vd }  t |  d d g  } t | t  j t  j t  j g  f Vd  S(   Nig      g      ?g       @g      i    g      (   R   R   R   R   t   nant   inf(   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_boxcox_nonfinite%   s    )c          c` s   t  j d d d d d d d g  }  t |  d  } t | t  j |   f Vt |  d  } t | |  f Vt |  d  } t | d	 |  d |  f Vt  j d	 d d g  } t d
 |  } t | d | f Vd  S(   Ng      пg#Bǻi    g#B;g      ?i   i   i   g      ?ig      (   R   R   R   R   t   log1p(   R   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_boxcox1p_basic1   s    $c          C` sY   t  j d d g  }  t  j d d g  } t |  |  } t | t  j |   d d d  S(   NgV瞯<gP7xf gC]r2<R   g+=(   R   R   R   R   R   (   R   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_boxcox1p_underflowF   s    c          c` s   t  j d d d g  }  t |  d d d g  } t | t  j t  j t  j t  j g  f Vd }  t |  d d g  } t | t  j t  j t  j g  f Vd  S(   Nig      g      ?g       @ig      i    (   R   R   R   R   R   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_boxcox1p_nonfiniteM   s    )c          C` s   t  j d d d g  }  t  j d d d g  } t |  |  } t | |  } t |  |  t  j d d d g  }  t  j d d d g  } t |  |  } t | |  } t |  |  d  S(   Ng        g      ?g       @(   R   R   R   R	   R   R   R
   (   R   R   R   t   x2(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_inv_boxcoxY   s    c          C` s2   d }  d } t  |  |  } t | |  d d d  S(   NgV瞯<gP7xf R   g+=(   R
   R   (   R   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   test_inv_boxcox1p_underflowg   s    t   __main__(   t
   __future__R    R   R   t   numpyR   t   numpy.testingR   R   R   R   t   scipy.specialR   R   R	   R
   R   R   R   R   R   R   R   R   t   __name__(    (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_boxcox.pyt   <module>   s   ""								