U
    »mœd¥  ã                   @   s|   d Z ddlZzddlZW n ek
r0   dZY nX edksBedkrLddlZnddlmZ ddd„Zdd	„ Ze	d
krxeƒ  dS )z«
Platform independent script to download all the
`scipy.datasets` module data files.
This doesn't require a full scipy build.

Run: python _download_all.py <download_dir>
é    NÚ é   )Ú	_registryc                 C   sR   t dkrtdƒ‚| dkr"t  d¡} tj ¡ D ] \}}t jtj| ||| d� q,dS )a  
    Utility method to download all the dataset files
    for `scipy.datasets` module.

    Parameters
    ----------
    path : str, optional
        Directory path to download all the dataset files.
        If None, default to the system cache_dir detected by pooch.
    NzsMissing optional dependency 'pooch' required for scipy.datasets module. Please use pip or conda to install 'pooch'.ú
scipy-data)ÚurlZ
known_hashÚfnameÚpath)ÚpoochÚImportErrorÚos_cacher   ÚregistryÚitemsÚretrieveZregistry_urls)r   Zdataset_nameZdataset_hash© r   úU/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/scipy/datasets/_download_all.pyÚdownload_all   s    
 þr   c                  C   s<   t jdd�} | jddtt d¡dd� |  ¡ }t|jƒ d S )NzDownload SciPy data files.)Údescriptionr   ú?r   z.Directory path to download all the data files.)ÚnargsÚtypeÚdefaultÚhelp)	ÚargparseÚArgumentParserÚadd_argumentÚstrr	   r   Ú
parse_argsr   r   )ÚparserÚargsr   r   r   Úmain/   s    
þr   Ú__main__)N)
Ú__doc__r   r	   r
   Ú__package__r   r   r   r   Ú__name__r   r   r   r   Ú<module>   s   


	