
    IR-e                     z    d dl mZ ddlmZ ddgZddgZ G d dej                  Z G d dej                  ZdS )	    registry   )serialize_method_as	TableRead
TableWritec                   (     e Zd ZdZ fdZd Z xZS )r   ax  Read and parse a data table and return as a Table.

    This function provides the Table interface to the astropy unified I/O
    layer.  This allows easily reading a file in many supported data formats
    using syntax such as::

      >>> from astropy.table import Table
      >>> dat = Table.read('table.dat', format='ascii')
      >>> events = Table.read('events.fits', format='fits')

    Get help on the available readers for ``Table`` using the``help()`` method::

      >>> Table.read.help()  # Get help reading Table and list supported formats
      >>> Table.read.help('fits')  # Get detailed help on Table FITS reader
      >>> Table.read.list_formats()  # Print list of available formats

    See also: https://docs.astropy.org/en/stable/io/unified.html

    Parameters
    ----------
    *args : tuple, optional
        Positional arguments passed through to data reader. If supplied the
        first argument is typically the input filename.
    format : str
        File format specifier.
    units : list, dict, optional
        List or dict of units to apply to columns
    descriptions : list, dict, optional
        List or dict of descriptions to apply to columns
    **kwargs : dict, optional
        Keyword arguments passed through to data reader.

    Returns
    -------
    out : `~astropy.table.Table`
        Table corresponding to file contents

    Notes
    -----
    c                 R    t                                          ||dd            d S )Nreadr   super__init__selfinstancecls	__class__s      5lib/python3.11/site-packages/astropy/table/connect.pyr   zTableRead.__init__5   s*    3>>>>>    c                 l   | j         }|                    dd           }|                    dd           } | j        j        |g|R i |}||j        ur5	  ||d          }n&# t
          $ r t          d|j         d          w xY w|                    d|           |                    d|           |S )	NunitsdescriptionsF)copyz#could not convert reader output to z class.unitdescription)	_clspopr   r   r   	Exception	TypeError__name___set_column_attribute)r   argskwargsr   r   r   outs          r   __call__zTableRead.__call__9   s    i

7D))zz.$77 dm 6t666v66 cm##c#E***   O#,OOO  
 	!!&%000!!->>>
s   A" "#Br    
__module____qualname____doc__r   r%   __classcell__r   s   @r   r   r      sR        ' 'R? ? ? ? ?      r   c                   .     e Zd ZdZ fdZdddZ xZS )r   as  
    Write this Table object out in the specified format.

    This function provides the Table interface to the astropy unified I/O
    layer.  This allows easily writing a file in many supported data formats
    using syntax such as::

      >>> from astropy.table import Table
      >>> dat = Table([[1, 2], [3, 4]], names=('a', 'b'))
      >>> dat.write('table.dat', format='ascii')

    Get help on the available writers for ``Table`` using the``help()`` method::

      >>> Table.write.help()  # Get help writing Table and list supported formats
      >>> Table.write.help('fits')  # Get detailed help on Table FITS writer
      >>> Table.write.list_formats()  # Print list of available formats

    The ``serialize_method`` argument is explained in the section on
    `Table serialization methods
    <https://docs.astropy.org/en/latest/io/unified.html#table-serialization-methods>`_.

    See also: https://docs.astropy.org/en/stable/io/unified.html

    Parameters
    ----------
    *args : tuple, optional
        Positional arguments passed through to data writer. If supplied the
        first argument is the output filename.
    format : str
        File format specifier.
    serialize_method : str, dict, optional
        Serialization method specifier for columns.
    **kwargs : dict, optional
        Keyword arguments passed through to data writer.

    Notes
    -----
    c                 R    t                                          ||dd            d S )Nwriter   r   r   s      r   r   zTableWrite.__init__{   s*    3$?????r   N)serialize_methodc                    | j         }t          ||          5   | j        j        |g|R i | d d d            d S # 1 swxY w Y   d S )N)	_instancer   r   r.   )r   r/   r"   r#   r   s        r   r%   zTableWrite.__call__   s    > +;<< 	; 	;DM:4:::6:::	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	; 	;s   <A A r&   r+   s   @r   r   r   S   sf        % %N@ @ @ @ @ 04 ; ; ; ; ; ; ; ; ;r   N)	
astropy.ior   infor   __all____doctest_skip__UnifiedReadWriter   r    r   r   <module>r8      s           % % % % % %
%. E E E E E) E E EP/; /; /; /; /;* /; /; /; /; /;r   