ó
°™xTc           @   s¡   d  d l  m Z d  d l m Z d  d l Z d e j f d „  ƒ  YZ e j ƒ  j e ƒ Z	 e j
 e	 g ƒ Z d „  Z e d k r� e j d d	 ƒ j e ƒ n  d S(
   iÿÿÿÿ(   t   division(   t   sphere_surface_samplingNt   TestGoldenSpiralc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s:   t  j d d ƒ |  _ d |  _ d d d d d g |  _ d  S(   Nt   counti   g233333ã?gš™™™™™é¿g        g&‚U¿; å¿g™™™™™™Ù¿gFçt®¤Ïã?g�
}Dˆa¶?g      �<g+“7¢àï¿g³Z7Øá?g�™™™™™Ù?gÙÖunmFç?g/é&Pèâ¿gš™™™™™é?gtBìÁº¿(   g233333ã?gš™™™™™é¿g        (   g&‚U¿; å¿g™™™™™™Ù¿gFçt®¤Ïã?(   g�
}Dˆa¶?g      �<g+“7¢àï¿(   g³Z7Øá?g�™™™™™Ù?gÙÖunmFç?(   g/é&Pèâ¿gš™™™™™é?gtBìÁº¿(   R   t   golden_spiralt   samplingR   t   points(   t   self(    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyt   setUp	   s    	c         C   s   |  j  |  j j |  j ƒ d  S(   N(   t   assertEqualR   R   (   R   (    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyt
   test_count   s    c         C   s7   d d  l  } |  j |  j j d | j |  j d ƒ d  S(   Niÿÿÿÿi   i   (   t   matht   assertAlmostEqualR   t	   unit_areat   piR   (   R   R   (    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyt   test_unit_area   s
    	c         C   sk   t  |  j j ƒ } |  j t | ƒ t |  j ƒ ƒ x3 t | |  j ƒ D] \ } } |  j | | d ƒ qD Wd  S(   Ni   (   t   listR   R   R	   t   lent   zipt   assertIterablesAlmostEqual(   R   t   gott   leftt   right(    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyt   test_points%   s    c         C   sS   |  j  t | ƒ t | ƒ ƒ x0 t | | ƒ D] \ } } |  j | | | ƒ q, Wd  S(   N(   R	   R   R   R   (   R   R   R   t   digitst   e_leftt   e_right(    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyR   F   s    (   t   __name__t
   __module__R   R
   R   R   R   (    (    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyR      s
   			
	!c         C   s   t  S(   N(   t   alltests(   t   loadert   testst   pattern(    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyt
   load_testsZ   s    t   __main__t	   verbosityi   (   t
   __future__R    t   mmtbx.geometryR   t   unittestt   TestCaseR   t
   TestLoadert   loadTestsFromTestCaset   suite_golden_spiralt	   TestSuiteR   R!   R   t   TextTestRunnert   run(    (    (    s^   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/tests/tst_sphere_surface_sampling.pyt   <module>   s   H		