a
    ¨ˆcT  ã                   @   s*   d dl mZ ddlmZ eddd„ƒZdS )	é    )Úcontextmanageré   )ÚH5Fileúr+c                 k   s6   t | fd|i|¤Ž}z|V  W | ¡  n
| ¡  0 dS )aÇ  Context manager for reading an HDF5 file as an H5File object.

    Parameters
    ----------
    filename : str
        HDF5 file name.
    mode : str
        Mode to open the file:

        'r' : Read-only
        'w' : Write; create new file (an existing file would be deleted).
        'a' : Read and write to file; create if not existing
        'r+': Read and write to file; must already exist

    See `H5File` for additional keyword arguments.
    ÚmodeN)r   Úclose)Úfilenamer   ÚkwargsÚh5© r   úW/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/apptools/io/h5/utils.pyÚopen_h5file   s    r   N)r   )Ú
contextlibr   Úfiler   r   r   r   r   r   Ú<module>
   s   