U
    e»{j�	  ã                   @   s(   d Z ddlZg Zd	dd„Zd
dd„ZdS )z0Utility functions for ``constants`` sub-package.é    NTc                 c   sb   ddl m} t tt| ƒ ¡ ƒtt|ƒ ¡ ƒ¡D ],\}}t||ƒsFq0q0|rV|j|j	kr0|V  q0dS )a°  
    Generator to return a Constant object.

    Parameters
    ----------
    codata, iaudata : obj
        Modules containing CODATA and IAU constants of interest.

    module : obj
        Namespace module of interest.

    not_in_module_only : bool
        If ``True``, ignore constants that are already in the
        namespace of ``module``.

    Returns
    -------
    _c : Constant
        Constant object to process.

    é   )ÚConstantN)
Zconstantr   Ú	itertoolsÚchainÚsortedÚvarsÚitemsÚ
isinstanceÚabbrevÚ__dict__)ÚcodataÚiaudataÚmoduleÚnot_in_module_onlyr   Z_nmÚ_c© r   úV/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/constants/utils.pyÚ_get_c   s     ÿ
r   Fc              	   C   sx   t | |||d�D ]b}|r:| |j|j|j|j|j|j¡}n|}t||j|ƒ |dk	r| 	d 
|j|j|j|j¡¡ qdS )aù  
    Set constants in a given module namespace.

    Parameters
    ----------
    codata, iaudata : obj
        Modules containing CODATA and IAU constants of interest.

    module : obj
        Namespace module to modify with the given ``codata`` and ``iaudata``.

    not_in_module_only : bool
        If ``True``, constants that are already in the namespace
        of ``module`` will not be modified.

    doclines : list or None
        If a list is given, this list will be modified in-place to include
        documentation of modified constants. This can be used to update
        docstring of ``module``.

    set_class : bool
        Namespace of ``module`` is populated with ``_c.__class__``
        instead of just ``_c`` from :func:`_get_c`.

    )r   Nz{:^10} {:^14.9g} {:^16} {})r   Ú	__class__r
   ÚnameÚvalueZ_unit_stringZuncertaintyÚ	referenceÚsetattrÚappendÚformat)r   r   r   r   ZdoclinesZ	set_classr   r   r   r   r   Ú_set_c)   s*    ú	   ÿÿr   )T)TNF)Ú__doc__r   Ú__all__r   r   r   r   r   r   Ú<module>   s   
"     ÿ