B
    dl	                 @   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   sf   ddl m} xTttt|  tt| D ],\}}t||sHq2q2|rX|j|j	kr2|V  q2W d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   d/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/astropy/constants/utils.py_get_c   s    
r   Fc          	   C   s|   xvt | |||dD ]b}|r<||j|j|j|j|j|j}n|}t||j| |dk	r|	d
|j|j|j|j qW 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
   
  