ó
Ë½÷Xc           @` s´   d  Z  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 Z d d l m Z m Z m Z m Z d e j f d „  ƒ  YZ e d k r° e j ƒ  n  d S(	   s'    module to test interpolate_wrapper.py
i    (   t   divisiont   print_functiont   absolute_importN(   t   aranget   allcloset   onest   isnan(   t   lineart   logarithmict   block_average_abovet   nearestt   Testc           B` sJ   e  Z d  d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   gñhãˆµøä>c         C` sZ   xS t  | ƒ D]E \ } } |  j t | | | | ƒ pN t | ƒ oN t | | ƒ ƒ q Wd  S(   N(   t	   enumeratet
   assertTrueR   R   (   t   selft   xt   yt   rtolt   it   xi(    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   assertAllclose   s    c         C` sb   d } t  | ƒ } t  | ƒ } |  j | t | | | d ƒ ƒ |  j | t | | | d ƒ ƒ d  S(   Ni   gš™™™™™¹?(   R   R   R
   (   R   t   NR   R   (    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   test_nearest   s
     c         C` sg   d } t  | ƒ } t  | ƒ } t  | ƒ d } t | | | ƒ } |  j | d  d d d d d g ƒ d  S(   Ng     p§@g      à?i   g      ø?g      @g      @g      @(   R   R   R   (   R   R   R   R   t   new_xt   new_y(    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   test_linear   s    c         C` sw   d } t  | d t ƒ} t  | d t ƒ} t  | d ƒ d } t | | | ƒ } |  j | d  d d d d d	 g ƒ d  S(
   Ni¸  t   dtypei   i   g        g      à?g      @g      @g      @(   R   t   floatR	   R   (   R   R   R   R   R   R   (    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   test_block_average_above%   s    c         C` sÚ   d } t  | d t ƒ} t d | f ƒ t  | ƒ } t  | ƒ d } t | | | ƒ } |  j | d  d … d  d … f d d d d d	 g d d d d d	 g d d d d d	 g d d d d d	 g d d d d d	 g g ƒ d  S(
   Ni¸  R   id   g      à?i   g      ø?g      @g      @g      @(   R   R   R   R   R   (   R   R   R   R   R   R   (    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   test_linear2.   s    c         C` sp   d } t  | ƒ } t  | ƒ } t  | ƒ d } t | | | ƒ } t j d d d d g } |  j | d  | ƒ d  S(   Ng     @¯@g      à?gß'Üež ö?g€©Ž˜@gn]ÿèz¶@gFB›wã@i   (   R   R   t   npt   NaNR   (   R   R   R   R   R   R   t	   correct_y(    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   test_logarithmic;   s    c         B` sU   g  e  |  ƒ D]! } | j d ƒ d k r | ^ q } x | D] } d | d  Uq; Wd  S(   Nt   test_i    s	   self.%s()(   t   dirt   find(   R   t   namet	   test_listt	   test_name(    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   runTestD   s    4(	   t   __name__t
   __module__R   R   R   R   R   R!   R(   (    (    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyR      s   								t   __main__(   t   __doc__t
   __future__R    R   R   t   unittestt   numpyR   R   R   R   R   t%   scipy.interpolate.interpolate_wrapperR   R   R	   R
   t   TestCaseR   R)   t   main(    (    (    sO   /tmp/pip-build-7oUkmx/scipy/scipy/interpolate/tests/test_interpolate_wrapper.pyt   <module>   s   "":