From 0cd55ab827a6c8ec07c12f603e29c7ca66748386 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Sun, 9 Aug 2020 13:39:56 +0200 Subject: [PATCH 1/4] Added xarray to dependecies --- binder/environment.yml | 1 + environment.yml | 1 + requirements.txt | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) 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..8d232224 100644 --- a/environment.yml +++ b/environment.yml @@ -27,3 +27,4 @@ dependencies: - jupyterlab=2 - ipyvolume=0.6.0a6 - nodejs=13 + - xarray diff --git a/requirements.txt b/requirements.txt index ef1e18d5..a48fc509 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,5 @@ 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 From 45dd601f6a7371c292338b541f575ef914d863f6 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Mon, 10 Aug 2020 08:30:37 +0200 Subject: [PATCH 2/4] Added netcdf4 to none binder dependencies --- environment.yml | 2 ++ requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/environment.yml b/environment.yml index 8d232224..34696f8f 100644 --- a/environment.yml +++ b/environment.yml @@ -28,3 +28,5 @@ dependencies: - ipyvolume=0.6.0a6 - nodejs=13 - xarray + - pip: + - netcdf4 diff --git a/requirements.txt b/requirements.txt index a48fc509..d02b7aef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,3 +22,4 @@ voila-vuetify sidecar ipyvolume==0.6.0-a.6 xarray +netcdf4 From a8abecda11da1b0173d3186d080bb56a9ee6e7d7 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Mon, 10 Aug 2020 08:47:51 +0200 Subject: [PATCH 3/4] Added download code for 'wind-global.nc' to normal code cell and removed now obsolete download instructions. Also added 'wind-global.nc' to .gitignore, so it won't be uploaded accidentally. --- .gitignore | 2 ++ notebooks/07.01-ipyleaflet.ipynb | 28 +++++++++++----------------- 2 files changed, 13 insertions(+), 17 deletions(-) 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/notebooks/07.01-ipyleaflet.ipynb b/notebooks/07.01-ipyleaflet.ipynb index 887382b7..4326a323 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)" ] }, { From 9de64358d0ccbd798a83c37c7836d522795cd501 Mon Sep 17 00:00:00 2001 From: s-weigand Date: Mon, 10 Aug 2020 08:51:38 +0200 Subject: [PATCH 4/4] Made the velocity map last statement of the input cell, so it is show in the output cell as well as in the Sidecar. --- notebooks/07.01-ipyleaflet.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notebooks/07.01-ipyleaflet.ipynb b/notebooks/07.01-ipyleaflet.ipynb index 4326a323..2cdb62c2 100644 --- a/notebooks/07.01-ipyleaflet.ipynb +++ b/notebooks/07.01-ipyleaflet.ipynb @@ -516,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" ] }, {