HOME


sh-3ll 1.0
DIR:/usr/local/lib/python3.6/site-packages/xarray/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/xarray/__pycache__/tutorial.cpython-36.pyc
3

���hp�@sDdZddlZddlmZddlmZej	j
d�Zded	fd
d�ZdS)
zR
Useful for:

* users learning xarray
* building tutorials in the documentation.

�N�)�open_dataset)�urlretrieve�~�.xarray_tutorial_dataTz%https://github.com/pydata/xarray-datac
Ks�tjj|�}|d}tjj||f�}tjj|�sbtjj|�sFtj|�dj|dd|f�}t||�t	|f|�j
�}	|s�tj|�|	S)ak
    Load a dataset from the online repository (requires internet).

    If a local copy is found then always use that to avoid network traffic.

    Parameters
    ----------
    name : str
        Name of the netcdf file containing the dataset
        ie. 'air_temperature'
    cache_dir : string, optional
        The directory in which to search for and write cached data.
    cache : boolean, optional
        If True, then cache data locally for use on subsequent calls
    github_url : string
        Github repository where the data is stored
    kws : dict, optional
        Passed to xarray.open_dataset

    z.nc�/�rawZmaster)�_os�path�
expanduser�sep�join�exists�isdir�mkdir�_urlretrieve�
_open_dataset�load�remove)
�name�cache�	cache_dirZ
github_url�kwsZlongdir�fullname�	localfile�urlZds�r�//tmp/pip-build-5_djhm0z/xray/xarray/tutorial.py�load_datasets


r)rr)
�__doc__�osr	Zbackends.apirrZ
core.pycompatrrrr
Z_default_cache_dirrrrrr�<module>s