diff --git a/.gitignore b/.gitignore index 93e00d56..8ed6ac8e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ notebooks/__pycache__ .cache .pytest_cache __pycache__ +# data file downloaded in notebooks/07.01-ipyleaflet.ipynb +wind-global.nc diff --git a/binder/environment.yml b/binder/environment.yml index 89b0a0ee..526ac27e 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -25,5 +25,6 @@ dependencies: - voila-vuetify - jupyterlab=2 - ipyvolume=0.6.0a6 + - xarray - pip: - netcdf4 diff --git a/environment.yml b/environment.yml index 0ad11f3b..34696f8f 100644 --- a/environment.yml +++ b/environment.yml @@ -27,3 +27,6 @@ dependencies: - jupyterlab=2 - ipyvolume=0.6.0a6 - nodejs=13 + - xarray + - pip: + - netcdf4 diff --git a/notebooks/07.01-ipyleaflet.ipynb b/notebooks/07.01-ipyleaflet.ipynb index 887382b7..2cdb62c2 100644 --- a/notebooks/07.01-ipyleaflet.ipynb +++ b/notebooks/07.01-ipyleaflet.ipynb @@ -451,28 +451,22 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Advanced example 1: Velocity\n", - "\n", - "*It is ok to skip this for now -- running it requires downloading a ~1MB data file.*\n", - "\n", - "This example needs an extra dependency that is not in the installation instructions and a dataset.\n", - "\n", - "You can install it with this:\n", - "\n", - "```bash\n", - "pip install netcdf4\n", - "```\n", - "\n", - "To download the data, copy and paste the code below into a new cell and run it.\n", - "\n", - "```python\n", + "## Advanced example 1: Velocity" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Download the data\n", "import requests\n", "\n", "wind_data = requests.get('https://github.com/benbovy/xvelmap/raw/master/notebooks/wind-global.nc') \n", "\n", "with open('wind-global.nc', 'wb') as f: \n", - " f.write(wind_data.content)\n", - "```\n" + " f.write(wind_data.content)" ] }, { @@ -522,7 +516,8 @@ " velocity_scale=0.01,\n", " max_velocity=20,\n", " display_options=display_options)\n", - "m2.add_layer(wind)" + "m2.add_layer(wind)\n", + "m2" ] }, { diff --git a/requirements.txt b/requirements.txt index ef1e18d5..d02b7aef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,6 @@ jupyterlab>=2 ipyvuetify voila-vuetify sidecar -ipyvolume==0.6.0-a.6 \ No newline at end of file +ipyvolume==0.6.0-a.6 +xarray +netcdf4