
     i.                     2    d Z ddlmZ ddlmZ ddZd	dZdS )
z
Common functions for auxiliary reading --- :mod:`MDAnalysis.auxiliary.core`
===========================================================================

.. autofunction:: get_auxreader_for
.. autofunction:: auxreader
   )_AUXREADERS   )utilNc                 n   | s|st          d          |pt          | t                    rt          j        |           }n	 |                                }	 t          |         S # t          $ r d|  }t          |          dw xY w	 t          |         S # t          $ r d| }t          |          dw xY w)a  Return the appropriate auxiliary reader class for *auxdata*/*format*.

    If *format* is provided, will attempt to find an AuxReader corresponding
    to that format. If *auxdata* is provided, the format will first be guessed.

    Parameters
    ----------
    auxdata
        (Optional) The auxiliary data (e.g. filename of file containing
        auxiliary data).
    format
        (Optional). Known format of *auxdata*.

    Returns
    -------
    :class:`~MDAnalysis.auxiliary.base.AuxReader`
        AuxReader class corresponding to the supplied/guessed format.

    Raises
    ------
    ValueError
        If an AuxReader for the format (provided or guessed from *auxdata*)
        cannot be found.

    z%Must provide either auxdata or formatNz+Unknown auxiliary data format for auxdata: zUnknown auxiliary data format )
ValueError
isinstancestrr   guess_formatupperr   KeyError)auxdataformaterrmsgs      c/srv/www/vhosts/g4struct/public_html/venv/lib/python3.11/site-packages/MDAnalysis/auxiliary/core.pyget_auxreader_forr   #   s    4  B6 B@AAA~gs## 	&w//FF 	/v&& 	/ 	/ 	/L7LLFV$$$.	/	/v&& 	/ 	/ 	/>f>>FV$$$.	/s   A# # BB  B4c                 6    t          | |          } || fi |S )aY  Return an auxiliary reader instance for *auxdata*.

    An appropriate reader class is first obtained using
    :func:`get_auxreader_for`, and an auxiliary reader instance for *auxdata*
    then created and returned.

    Parameters
    ----------
    auxdata
        Auxiliary data (e.g. filename of file containing auxiliary data).
    format
        (Optional). The format of *auxdata*, if known.
    **kwargs
         Additional AuxReader options.

    Returns
    -------
    :class:`~MDAnalysis.auxiliary.base.AuxReader` instance
        Appropriate auxiliary reader instance for *auxdata*.
    )r   )r   )r   r   kwargsreaders       r   	auxreaderr   U   s.    * wv666F6'$$V$$$    )NN)N)__doc__ r   libr   r   r    r   r   <module>r      sh   0             // // // //d% % % % % %r   