ó
HxTc           @   s   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z d   Z	 d   Z
 d   Z e d	 k r e   n  d
 S(   i˙˙˙˙(   t   division(   t   xray(   t   flex(   t   tst_xray_minimization(   t   sgtbxc          C   sŁ  d d  l  }  d d  l } |  j j | j j d   } |  j j | j j d   } | j   | j   | j d t d d d d d	 t	  j
   } t |  } | j   } | j   } t j | d
  t j j d t j j |  d | d t d d  d d  } | j | j k  st  | j   | j d | d d d	 t	  j
   }	 t |	  }	 t j | j   |	 j    }
 |
 j   st  |
 j   } | d k st  d  S(   Ni˙˙˙˙s   structure_ideal.pickles   structure_start.picklet   anomalous_flagt   d_ming      @t	   algorithmt   directt   cos_sin_tablegüŠńŇMbP?t   target_functort   xray_structuret    use_special_position_constraintst   occupancy_penaltyt   structure_factor_algorithmg+ŮÎ÷ď?(   t   libtbx.easy_picklet   os.patht   easy_picklet   loadt   patht
   expandusert   show_scattererst   structure_factorst   Falset   Truet   f_calct   abst   deep_copy_scatterersR   t   shift_u_anisoR   t   minimizationt   lbfgst   target_functorst   intensity_correlationt   Nonet   final_target_valuet   first_target_valuet   AssertionErrort!   structure_factors_from_scatterersR   t   linear_correlationt   datat   is_well_definedt   coefficient(   t   libtbxt   ost   structure_idealt   structure_startt
   rnd_f_calct   y_obst   structure_shaket   structure_shake_bist	   minimizert   f_finalt   ct   c_coefficient(    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_xray_minimization_failure.pyt   test1   sD    		

		
	c          C   s   d d  l  }  d d  l } |  j | j j d   t j d t j j	 d d d t
 j d  d t d	 t j j d
 d d d d d d d  d d  d d  d  S(   Ni˙˙˙˙s   random_generator_state.pickleR
   t	   data_typet   Ft   space_group_infos	   R -3 c :HR   t   gradient_flagst   sitei    t   u_isot   u_anisoi   t	   occupancyR   R   g      @(   t   randomR   t   setstateR   R   R   t   exerciseR   R   R    R   R9   R   R   R:   R!   (   R?   R*   (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_xray_minimization_failure.pyt   test2.   s    		c           C   s   t    t   d GHd  S(   Nt   OK(   RB   R6   (    (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_xray_minimization_failure.pyt   run?   s    t   __main__N(   t
   __future__R    t   cctbxR   t   cctbx.array_familyR   t   cctbx.regressionR   R   R6   RB   RD   t   __name__(    (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/regression/tst_xray_minimization_failure.pyt   <module>   s   	&		