ó
Ë™xTc           @`  sU   d  d l  m Z m Z d  d l Z d  d l m Z d „  Z e d k rQ e ƒ  n  d S(   i    (   t   divisiont   absolute_importN(   t   easy_runc    
      C`  s|  y d d  l  }  d d  l } Wn t k
 r5 d GHd  SXd d l m } d } | d | d t ƒ \ } } d | d | d d	 d
 d d g } t j d d j | ƒ ƒ j	 ƒ  } t
 j | ƒ t
 j | ƒ t
 j t
 j j | ƒ d d  d ƒ t
 j t
 j j | ƒ d d  d ƒ d } x* | j D] }	 d |	 k r | d 7} q q W| d k rsd j | j ƒ GHt d | ƒ ‚ n  d GHd  S(   Ni    s(   libsvm not available, skipping this test(   t   generate_calcium_inputst   tst_pick_ca_svmt	   file_baset	   anonymizes   "%s"s   wavelength=1.1s   nproc=1s   use_phaser=Falses   use_svm=Trues   elements=CA,ZNs   mmtbx.water_screen %st    iüÿÿÿs   .pdbs   _fmodel.effs   Final choice: CAi   s   
s   Expected 1 Ca2+, found %dt   OK(   t   svmt   svmutilt   ImportErrort)   mmtbx.regression.make_fake_anomalous_dataR   t   TrueR   t   fully_bufferedt   joint   raise_if_errorst   ost   removet   patht   splitextt   stdout_linest   RuntimeError(
   R	   R
   R   t   baset   mtz_filet   pdb_filet   argst   resultt   n_cat   line(    (    sH   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/ions/tst_pick_ca_svm.pyt   exercise   s0    "%%t   __main__(   t
   __future__R    R   R   t   libtbxR   R   t   __name__(    (    (    sH   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/ions/tst_pick_ca_svm.pyt   <module>   s
   	