a
    ߙfb                     @   s  d Z ddlZddlZddlmZ d#ddZdev r8dZnd	e d
ZddlmZ	 G dd de	j
Ze ZddlmZ G dd deZG dd deZG dd deZddlmZ eed Zdd Zdd Ze  ZZddlmZmZ e Ze  ddlm Z  dd Z!g dZ"ddl#m$Z% e& D ]hZ'e'(d r>e')d s"e'e"v s"e'd d!kre*e+ e' e%re+ e' j,(e,d" s"e+ e'= q"['[%dS )$z
Astropy is a package intended to contain core functionality and some
common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for
managing them.
    N   )versionc                 C   s\   | du r"t jt jtt j} nt j| r:t j| } t j| }t jt j|dS )zs
    Returns whether the source for this module is directly in an astropy
    source distribution or checkout.
    Nz.astropy-root)	ospathjoindirname__file__pardirisfileabspathexists)r   Z
source_dir r   /lib/python3.9/site-packages/astropy/__init__.py_is_astropy_source   s    	r   devz#https://docs.astropy.org/en/latest/https://docs.astropy.org/en//)configc                   @   s^   e Zd ZdZeddZejejdkdddgdZ	ejd	d
ddgdZ
ejd	dddgdZd	S )Confz1
    Configuration parameters for `astropy`.
    Fz`When True, use Unicode characters when outputting values, and displaying widgets at the console.Zwin32zGWhen True, use ANSI color escape sequences when writing to the console.zastropy.utils.console.USE_COLORzastropy.logger.USE_COLOR)aliasesNzMaximum number of lines in the display of pretty-printed objects. If not provided, try to determine automatically from the terminal size.  Negative numbers mean no limit.zinteger(default=None)zastropy.table.pprint.max_lines)ZdescriptionZcfgtyper   zMaximum number of characters per line in the display of pretty-printed objects.  If not provided, try to determine automatically from the terminal size. Negative numbers mean no limit.zastropy.table.pprint.max_width)__name__
__module____qualname____doc___configZ
ConfigItemZunicode_outputsysplatformZ	use_colorZ	max_linesZ	max_widthr   r   r   r   r   ,   s,   r   )ScienceStatec                       s>   e Zd ZdZdZeddZedd Ze fddZ	  Z
S )base_constants_versionz7
    Base class for the real version-setters below
    test)r   c                 C   s,   || j vr"tdt| j   | j | S )NzMust be one of )	_versions
ValueErrorlistkeys)clsvaluer   r   r   validateY   s    
zbase_constants_version.validatec                    s8   ddl }d|jv rtdd|jv r,tdt |S )z2
        Set the current constants value.
        r   Nzastropy.unitsz!astropy.units is already importedzastropy.constantsz%astropy.constants is already imported)r   modulesRuntimeErrorsuperset)r$   r%   r   	__class__r   r   r*   _   s    

zbase_constants_version.set)r   r   r   r   _valuedictr    classmethodr&   r*   __classcell__r   r   r+   r   r   Q   s   

r   c                   @   s(   e Zd ZdZdZedddddddZdS )physical_constantsz2
    The version of physical constants to use
    
codata2018
codata2014
codata2010)r2   r3   r4   astropyconst40astropyconst20astropyconst13Nr   r   r   r   r-   r.   r    r   r   r   r   r1   m   s   r1   c                   @   s&   e Zd ZdZdZeddddddZdS )astronomical_constantsz6
    The version of astronomical constants to use
    iau2015iau2012)r:   r;   r5   r6   r7   Nr8   r   r   r   r   r9   y   s   r9   )
TestRunnerc                  C   s:   zddl m}  W n$ ty4   t r.tdn Y n0 d S )Nr   	_compilera  You appear to be trying to import astropy from within a source checkout or from an editable installation without building the extension modules first. Either run:

  pip install -e .

or

  python setup.py build_ext --inplace

to make sure the extension modules are built )Zutilsr>   ImportErrorr   r=   r   r   r   _initialize_astropy   s    
	r@   c                  C   s   t jt jtd} t| dP}| ddd  }t|dkrTW d    dS d|d  }W d    n1 sv0    Y  |S )NZCITATIONrz@ARTICLEr   r    )	r   r   r   r   r   openreadsplitlen)Zcitation_fileZcitationZrefsZbibtexreferencer   r   r   _get_bibtex   s    ,rG   )	_init_log_teardown_log)find_api_pagec                 C   sT   ddl m} ddl}t}d|v r&d}nd| }d| d|d	| i }|| dS )
z
    Search the online Astropy documentation for the given query.
    Opens the results in the default web browser.  Requires an active
    Internet connection.

    Parameters
    ----------
    query : str
        The search query.
    r   )	urlencodeNr   Zlatestvr   z/search.html?q)Zurllib.parserK   
webbrowser__version__rC   )ZqueryrK   rN   r   Zurlr   r   r   online_help   s    rP   )rO   Z__githash__
__bibtex__r   logrJ   rP   online_docs_rootconfr1   r9   )
ModuleType___.)N)-r   r   r   r   rO   r   rS   rB   r   r   ZConfigNamespacer   rT   Zutils.stater   r   r1   r9   Ztests.runnerr<   Zmake_test_runner_in__path__r   r@   rG   Z__citation__rQ   ZloggerrH   rI   rR   Z
utils.miscrJ   rP   Z__dir_inc__typesrU   Z__module_type__dirZvarname
startswithendswith
isinstancelocalsr   r   r   r   r   <module>   sL   



