ó
¤>dc           @   sK   d  d l  Z  d  d l Z d  d l m Z d e f d „  ƒ  YZ d „  Z d S(   iÿÿÿÿN(   t
   fast5_filet
   FileToDictc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   i  |  _  d  S(   N(   t   contents(   t   self(    (    s>   /tmp/pip-install-m8tpmx/ont-fast5-api/ont_fast5_api/helpers.pyt   __init__   s    c         C   sÄ   t  | t j ƒ r" d |  j | <nN d |  j | <t t j | ƒ ƒ |  j d j | ƒ <| j j	 |  j d j | ƒ <i  } x1 | j
 D]& } t t j | j
 | ƒ ƒ | | <q€ W| |  j d j | ƒ <d  S(   Nt   groupt   datasets   {}.datas   {}.colss   {}.attrs(   t
   isinstancet   h5pyt   GroupR   t   strt   f5ft   _sanitize_data_for_readingt   formatt   dtypet   namest   attrst   None(   R   t   namet   objt   attrdictt   item(    (    s>   /tmp/pip-install-m8tpmx/ont-fast5-api/ont_fast5_api/helpers.pyt   scan   s    %$(   t   __name__t
   __module__R   R   (    (    (    s>   /tmp/pip-install-m8tpmx/ont-fast5-api/ont_fast5_api/helpers.pyR      s   	c         C   s¡   t  j d ƒ t  j d t ƒ t ƒ  } t ƒ  } | j } | j } t j |  d ƒ  } | j | ƒ Wd QXt j | d ƒ  } | j | ƒ Wd QX| j	 | j	 k S(   s˜    Compare two hdf files.
    :param file1: First file to compare.
    :param file2: Second file to compare.

    :returns True if they are the same.
    t   defaults}   'compare_hdf_files': HDF5 comparison is deprecated. 
If this feature is still required please contact the project maintainerst   rN(
   t   warningst   simplefiltert   warnt   DeprecationWarningR   R   R   t   Filet
   visititemsR   (   t   file1t   file2t   data1t   data2t   scanner1t   scanner2t   fh1t   fh2(    (    s>   /tmp/pip-install-m8tpmx/ont-fast5-api/ont_fast5_api/helpers.pyt   compare_hdf_files   s    					(   R   R   t   ont_fast5_apiR    R   t   objectR   R)   (    (    (    s>   /tmp/pip-install-m8tpmx/ont-fast5-api/ont_fast5_api/helpers.pyt   <module>   s   